RR - Round Robin. Assume the quantum is 3. The Gantt chart can also be used to find the finish times for this preemptive scheduling algorithm.
Gantt Chart:+------------------------------------------+ | P1 | P2 | P3 | P1* | P2* | P3* | +------------------------------------------+ 0 3 6 9 10 13 14 Time 0 1 2 3 READY P1 P2 P2 P2 ... P3 P3 P1
From the Gantt chart, finish times are:
Process | Finish | Wait |
---|---|---|
P1 | 10 | 6 |
P2 | 13 | 6 |
P3 | 14 | 8 |
So, for example, the wait time for P3 is:
Wait = Finish - Arrival - CPU_Burst = 14 - 2 - 4 = 8
and the average wait time for these three:
Avg. Wait = (6 + 6 + 8)/3 = 6.667