21.01.2015 Views

INtime® 3.1 Software - tenAsys

INtime® 3.1 Software - tenAsys

INtime® 3.1 Software - tenAsys

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

INtime <strong>3.1</strong> <strong>Software</strong><br />

Figure 4-1. Thread switching in a multithreading environment<br />

Thread A<br />

Thread B<br />

<br />

The processor executes thread A.<br />

An event happens and a thread switch occurs. The processor then executes thread B.<br />

When thread B finishes, thread A becomes the running thread again.<br />

Multithreading and modular programming go hand-in-hand. You start by breaking<br />

down a large, difficult application problem into successively smaller and simpler<br />

problems, grouping similar problems where you can. Finally, you solve the small<br />

problems in separate program modules. In the INtime software multithreading<br />

environment, each module is a thread.<br />

Multithreading simplifies building an application. When you need a new function, you<br />

just add a new thread.<br />

When you combine multithreading with preemptive, priority-based scheduling, your<br />

application can switch as appropriate: from relatively unimportant threads, to<br />

important threads, to critical threads, and back again.<br />

40

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!