Tuesday, March 18, 2008

Operating System concepts

Round Robin Scheduling
The round robin Scheduling algorithm is designed especially for time sharing systems. A small unit of time, called time quantum, or a time slice. The ready queue is treated as a circular queue. The CPU scheduler goes around the ready queue, allocating the CPU to each process for a time interval of up to 1 time quantum.
To implement RR scheduling the ready queue as a FIFO queue of process. New process are added to the tail of the ready queue. The CPU scheduler picks the first process from the ready queue ,sets a timer to interrupt after 1 time quantum, and dispatches the process.

The average waiting time under the RR policy, however, is often quite long.
Consider the following set of processes that arrive at time 0,with the length of the CPU –burst time given in milliseconds:
Process Burst Time
p1 4
p2 3
p3 6
p4 3
Quantum=2;
P1 p2 p3 p4 p1 p2 p3 p4 p3
0 2 4 6 8 10 11 13 14 16

No comments: