Complete Computer Knowledge Portal

Wednesday, April 24, 2013

Round-Robin Scheduling

It is the CPU Scheduling Technique specially designed  for the time shared systems. This Technique is similar to FCFS Technique but the difference is that processes are switched at a regular interval of time and the regular internal is called time quantum.The can be from 0 to 100 milliseconds.

The ready queue is used in a circular fashion. The CPU is allocated to each process for a regular interval of time of 1 time quantum each new process is added to the tail ready queue. CPU scheduling picks first process from ready queue, set a timer to interrupt after 1 time quantum and then process is dispatched.If the burst time of process is less than a time quantum then it will automatically release the CPU.The average waiting time a round Robin policy is often high.


Consider the following ready queue of processes.
Process               Burst time
   P1                           10
   P2                           20
   P3                           5


Let the time Quantum be 5 miliseconds. The Gantt chart will be as given below

Now the average wait time for P1 is (15-5) 10 milliseconds, for P2=(20-5) 15 Milliseconds,and for P3=10 millisecond. i.e. the total average wait time is :10 + 15 + 10 /3 =11.66 Milliseconds

The performance for this Technique depands upon time quantum. If it is too high this algorithm will work like FCFS Technique and if it is too low than it creates the appearance that n processes are running with their own processor at a speed of 1/n.

No comments:

Post a Comment