Information Technology Reference
In-Depth Information
Figure7.2: Completion times with Round Robin scheduling when short tasks
arrive just after a long task, with a time quantum of 1ms and 100ms.
choices | for average response time.
3. Suppose you do your homework assignments in SJF-order. After all, you
feel like you are making a lot of progress! What might go wrong?
7.1.3
Round robin
A policy that addresses starvation is to schedule tasks in a round robin fashion.
With Round Robin, tasks take turns running on the processor for a limited
period of time. The scheduler assigns the processor to the first task in the
ready queue, setting a timer interrupt for some delay, called the time quantum.
Denition: time quantum
At the end of the quantum, if the task hasn't completed, the task is preempted
and the processor is given to the next task in the ready queue. The preempted
task is put back on the ready queue where it can wait its next turn. With Round
Robin, there is no possibility that a task will starve | it will eventually reach
the front of the queue and get its time quantum.
Of course, we need to pick the time quantum carefully. One consideration
is overhead: if we have too short a time quantum, the processor will spend all
of its time switching and getting very little useful work done. But if we pick
too long a time quantum, tasks will have to wait a long time until they get a
Search WWH ::




Custom Search