Operating System
Operating System
Consider the following set of processes, with arrival times and the CPU-burst times
given in milliseconds.
What is the average turnaround time for these processes with the preemptive
Shortest Remaining Processing Time first (SRTF) algorithm?
Soln: The Gantt Chart for SRTF CPU scheduling algorithm is
P1 P2 P2 P2 P4 P3 P3 P3 P1 P1 P1 P1
0 1 2 3 4 5 6 7 8 9 10 11 12
Turnaround Time of P1 = 12 – 0 = 12
Turnaround Time of P2 = 4 – 1 = 3
Turnaround Time of P3 = 8 – 2 = 6
Turnaround Time of P4 = 5 – 4 = 1