GATE / CS ARCHIVE

GATE CSE 2016 SET 2 / QUESTION 48

GATE CSE 2016 Set 2 Q48

Operating Systems · Synchronization & Concurrency · Full GATE CSE 2016 Set 2 paper

GATE 2016 Set 2, Q48 2 marks · MCQ
Report issue

Synchronization & Concurrency

Question 48, GATE 2016: Two processes share turn=0. Process 0 entry waits while turn==1, then executes its critical section and sets turn=1 on exit. Process 1 waits while turn==0, executes its critical section and sets turn=0 on exit. A correct solution; B violates mutual exclusion; C violates progress; D violates bounded waiting.
Tap to enlarge
Your answer
Answer & solution

Official answer: C

This is strict alternation. If process 0 finishes its critical section and remains in its remainder section, turn becomes 1. Process1 may enter and leave, setting turn back 0. A further request by process 1 is then blocked even though process 0 is not competing. This violates progress. Mutual exclusion holds because turn cannot be both 0 and 1; the intended answer is C under the standard synchronization-property definitions.

An even simpler progress witness occurs initially: only process 1 requests entry while process 0 stays forever in its remainder section. turn remains 0, so the empty critical section is inaccessible to the sole interested process. Strict alternation limits overtaking but lets an uninterested process prevent entry, which is why mutual exclusion alone is insufficient.

Original paper, page 40 · Answer key