Information Technology Reference
In-Depth Information
Figure7.4: Scheduling behavior with Round Robin when running a mixture
of I/O-bound and compute-bound tasks.
consider what SJF does on this workload. SJF schedules tasks in exactly the
same order as FIFO. The first task that arrives will be assigned the processor,
and as soon as it executes a single instruction, it will have less time remaining
than all of the other tasks, and so it will run to completion. Since we know SJF
is optimal, this means that both FIFO and Round Robin are optimal for some
workloads and pessimal for others, just different ones in each case.
Depending on the time quantum, Round Robin can also be quite poor when
running a mixture of I/O-bound and compute-bound tasks. I/O-bound tasks
often need very short periods on the processor in order to compute the next
I/O operation to issue. Any delay to get scheduled onto the processor can lead
to system-wide slowdowns. For example, in a text editor, it often takes only
a few milliseconds to echo a keystroke to the screen, a delay much faster than
human perception. However, if we are sharing the processor between a text
editor and several other tasks using Round Robin, the editor must wait several
time quanta to be scheduled for each keystroke | with a 100ms time quantum,
this can become annoyingly apparent to the user.
Figure 7.4 illustrates similar behavior with a disk-bound task. Suppose we
have a task that computes for 1ms and then uses the disk for 10ms, in a loop.
Running alone, it can keep the disk almost completely busy. Suppose we also
have two compute bound tasks; again, running by themselves, they can keep
the processor busy. What happens when we run the disk-bound and compute-
bound tasks at the same time?
With Round Robin and a time quantum of
 
Search WWH ::




Custom Search