GATE / CS ARCHIVE

GATE CSE 2025 SET 1 / QUESTION 38

Scheduling processes on two priority-ordered CPUs

Operating Systems · CPU Scheduling · Full GATE CSE 2025 Set 1 paper

GATE 2025 Set 1, Q38 2 marks · MCQ
Report issue

CPU Scheduling

Question 38, GATE 2025: Four processes arrive at time 0 with CPU bursts P1=20, P2=16, P3=25, P4=10 ms. Scheduling is non-preemptive. M1 priority order is P1>P3>P2>P4; M2 order is P2>P3>P4>P1. A free processor chooses the highest-priority waiting process in its own order; a process runs on only one processor. Ignore switching overhead. Average waiting time? A 9.00; B 8.75; C 6.50; D 7.50 ms.
Tap to enlarge
Your answer
Answer & solution

Official answer: A

Approach: Build a timeline of processor release events, selecting only among processes still waiting at each event.
At t=0, M1 selects P1 and M2 selects P2. Neither process waits. Their completion times are 20 and 16 respectively.
At t=16, M2 becomes free while P3 and P4 are waiting. M2 ranks P3 above P4, so P3 begins at 16 and finishes at 41. At t=20, M1 becomes free; P3 is already running and cannot be scheduled again, so M1 begins P4, which finishes at 30.
Because all arrivals are at zero and scheduling is non-preemptive, waiting times equal start times: P1=0, P2=0, P3=16, P4=20. Their average is (0+0+16+20)/4=9.00 ms, option A.
Completion times must not be averaged as waiting times, and priority orders are applied only to eligible waiting processes, not to processes already executing elsewhere.

Original paper, page 38 · Answer key