Processes arrive in that order at times , and 8 milliseconds respectively, and have execution times of , and 9 milliseconds respectively. Shortest Remaining Time First (SRTF) algorithm is used as the CPU scheduling policy. Ignore context switching times.
Which ONE of the following correctly gives the average turnaround time of the four processes in milliseconds?
View worked solution
Answer: D
To find the average turnaround time, we trace the execution of the processes using the Shortest Remaining Time First (SRTF) scheduling algorithm:
- At : Only (burst time = 10) is available. starts executing.
- At : (burst time = 13) arrives. The remaining time for is 9. Since , continues execution.
- At : (burst time = 6) arrives. The remaining time for is 8. Since has the shortest remaining time (), is preempted, and starts executing.
- At : completes execution. (burst time = 9) arrives. The remaining times of the active processes are:
- : 8
- : 13
- : 9
- At : The remaining processes are (13) and (9). executes from to , completing at .
- At : Only (13) remains. It executes from to , completing at .
Now, we calculate the Turnaround Time () for each process:
| Process | Arrival Time () | Burst Time | Completion Time () | Turnaround Time () |
|---|---|---|---|---|
| 0 | 10 | 16 | ||
| 1 | 13 | 38 | ||
| 2 | 6 | 8 | ||
| 8 | 9 | 25 |
The average turnaround time is calculated as:
Free practice · Your answers on this page are not saved.
