Information Technology Reference
In-Depth Information
Figure7.3:Completion times with FIFO, SJF, and Round Robin when schedul-
ing equal length tasks.
Simultaneous Multi-Threading
Although zero overhead switching may seem far-fetched, most modern processors
do a form of it called simultaneous multi-threading (SMT) or hyperthreading. With SMT,
each processor simulates two (or more) virtual processors, alternating between them on
a cycle by cycle basis. Since most tasks need to wait for memory from time to time, the
other task can use the processor during those gaps, or vice versa. In normal operation,
neither task is significantly slowed when running on an SMT.
You can test whether your computer implements SMT by testing how fast the pro-
cessor operates when it has one or more tasks, each running a tight loop of arithmetic
operations. (Note that on a multicore, you will need to create enough tasks to fill up each
of the cores, or physical processors, before the system will begin to use SMT.) With one
task per physical processor, each task will run at the maximum rate of the processor.
With an SMT of two, and two tasks per processor, each task will run at somewhat less
than the maximum rate, but each task will run at approximately the same uniform speed.
As you increase the number of tasks beyond the SMT level, however, the operating sys-
tem will begin to use coarse-grained time-slicing, so tasks will progress in spurts —
alternating time on and off the processor.
Search WWH ::




Custom Search