Consider the following processes, with the arrival time and the length of the CPU burst given in milliseconds. The scheduling algorithm used is preemptive shortest remaining-time first.
The average turn around time of these processes is _________ milliseconds.
A |
8.25 |
B |
8.26 |
C |
8.27 |
D |
8.28 |
Here the scheduling algorithm used is preemptive shortest remaining-time first.
To answer the question we need to design the Gantt chart:
In this algorithm, the processes will be scheduled on the CPU which will be having the least remaining burst time.
Turnaround Time (TAT) = Completion Time (CT) - Arrival Time (AT)
TAT for P1 = 20 - 0 = 20,
TAT for P2 = 10 - 3 = 7,
TAT for P3 = 8 - 7 = 1,
TAT for P4 = 13 - 8 = 5.
Total TAT = 20 + 7 + 1 + 5 = 33 / 4 = 8.25 (Avg. TAT)