GATE 2017 CS (CS2) – Question 61
Processes P₁,…,P₅ have (arrival ms, CPU burst ms, priority): (0,11,2),(5,28,0),(12,2,3),(2,10,1),(9,16,4). Priority 0 is highest; none has I/O. Find mean waiting time with preemptive priority scheduling.
Practise this question in The GATE Grind →
Show answer and explanation
Correct answer: 29.0 to 29.0
Explanation
Run P₁:0–2, P₄:2–5, P₂:5–33, P₄:33–40, P₁:40–49, P₃:49–51, P₅:51–67. Waiting times C−arrival−burst are 38,0,37,28,42 ms. Their sum is 145, so average waiting time is 145/5=29 ms.