Numerical Solved by Round Robin
Q2. Take four processes that arrive at the same time in the following order and the time quantum is 20.
Process Burst Time
P1 53
P2 17
P3 68
P4 24
Draw Gantt Chart and calculate average turnaround and waiting time using Round Robin Scheduling Algorithm.
Ans.
Gantt Chart:
P1 | P2 | P3 | P4 | P1 | P3 | P4 | P1 | P3 | P3 |
0 20 37 57 77 97 117 121 134 154 162
Waiting Time
P1’s waiting time=57+24=81
P2’s waiting time=20
P3’s waiting time=37+40+17=94
P4’s waiting time=57+40=97
Average Waiting Time
=(81+20+94+97)/4
=73 milliseconds
Turnaround Time
Turnaround Time = Burst Time + Waiting Time
P1=53+81=134
P2=17+20=37
P3=68+9=162
P4=24+97=121
Average Turnaround Time
=(134+37+162+121)/4
=113.5 millisecond