GATE / CS ARCHIVE

GATE CSE 2022 / QUESTION 42

GATE CSE 2022 Q42

Operating Systems · CPU Scheduling · Full GATE CSE 2022 paper

GATE 2022, Q42 2 marks · MCQ
Report issue

CPU Scheduling

Question 42, GATE 2022: P,Q,R,S arrive at time zero in that order. Round-robin quantum is 4. Observed switches include exactly one S→Q, one R→Q, two Q→R and no S→P, counting switches after termination too. Which burst tuple (P,Q,R,S) is impossible? A (4,10,6,2); B (2,9,5,1); C (4,12,5,4); D (3,7,7,3).
Tap to enlarge
Your answer
Answer & solution

Official answer: D

With quantum 4, A, B, C each give execution segments P, Q, R, S, Q, R, Q: P and S finish in their first turn, R in its second, and Q in its third. This yields two Q→R switches, one R→Q and one S→Q. For D, burst times (3, 7, 7, 3) instead give P, Q, R, S, Q, R: Q finishes on its second turn, leaving no final R→Q switch. Thus D cannot produce the stated trace.

For option D the slices have lengths 3,4,4,3,3,3 respectively. The running order P,Q,R,S,Q,R has Q→R twice and S→Q once, but no R→Q. For A the slice lengths are 4,4,4,2,4,2,2, so P,Q,R,S,Q,R,Q satisfies all stated counts. B,C have that same order because Q needs three turns and R two.

Original paper, page 27 · Answer key