- GATE CS
- 2026–27 pattern practice
- Operating Systems
- Scheduling
- Medium
Processes P1, P2, P3 and P4 arrive at times 0, 1, 2 and 3 ms with CPU bursts of 8, 4, 9 and 5 ms. What is the average waiting time under preemptive Shortest Remaining Time First (SRTF)?
Process Management
Pick an option to check your answer.
Answer: D. Solution
Build the Gantt chart, always running the job with the least remaining time.
- P1 runs 0–1; P2 (4) beats P1's remaining 7 and runs 1–5.
- Then P4 runs 5–10, P1 runs 10–17 and P3 runs 17–26.
- Waiting time = completion − arrival − burst: P1 , P2 , P3 , P4 .
- Average ms.
Why not the others
- ms is the average under non-preemptive SJF for the same processes.
- ms corresponds to running the processes in arrival order (FCFS).
- ms leaves out part of P3's wait.