Q2. Let’s take three processes that arrive at the same time in this order:
Process CPU Time Needed (ms)
The processes are assumed to have arrived in order P1, P2 and P3, all at time 0.
Draw Gantt Chart, calculate Turnaround Time, Waiting Time, Average Turnaround Time and Average Waiting Time.
Ans. P1 starts at time 0 and ends at time 24.
P2 starts at time 24 and ends at time 27.
P3 starts at time 27 and ends at time 30.
Thus, P2 has to wait 24 milliseconds to start and P3 has to wait 27 milliseconds. The average waiting time here is:
0 24 27 30
P1’s waiting time=0
P2’s waiting time=24
P3’s waiting time=27
Average waiting time is the sum of waiting times of all the processes divided by number of processes.
Average Waiting Time
It is computed by subtracting the time the process entered the system from the time it terminated. Therefore we can say that:
Turnaround Time = Burst Time + Waiting Time
Process Turnaround Time
Average Turnaround Time