The GATE Grind

GATE 2017 CS (CS2) – Question 61

Operating System · CPU and I/O Scheduling · 2 marks · Numerical answer

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.

More CPU and I/O Scheduling questions

All CPU and I/O Scheduling questions →