All mock tests are FREE till 31 December — register to save your progress

Consider three processes: P0 (arrival 0 ms, burst 7 ms), P1 (arrival 1 ms, burst 3 ms), P2 (arrival 2 ms, burst 7 ms). Pre-emptive shortest job first scheduling is used, and scheduling happens only at arrival or completion of a process. What is the average waiting time?

Figure

Pick an option to check yourself, or open the answer below.

Show answer & explanation

Correct answer: B. 3.67 ms

Explanation

P0 runs 0–1; P1 (3) preempts and runs 1–4; then P0 (6 left) runs 4–10; P2 runs 10–17. Waiting: P0 = 10 − 7 = 3, P1 = 0, P2 = 17 − 2 − 7 = 8. Average 11/3 ≈ 3.67 ms.

More System Software and Operating System questions