The GATE Grind

GATE 2010 CS (CS1) – Question 33

Operating System · Concurrency and Synchronization · 1 mark · Multiple choice

Shared Boolean S1,S2 start with arbitrary values. P1 waits while S1==S2, enters its critical section, then assigns S1=S2. P2 waits while S1!=S2, enters its critical section, then assigns S2=!S1. Which properties hold?

  1. Mutual exclusion but not progress
  2. Progress but not mutual exclusion
  3. Neither
  4. Both

Practise this question in The GATE Grind →

Show answer and explanation

Correct answer: (A) Mutual exclusion but not progress

Explanation

The entry conditions are complementary, so only one process can enter, preserving mutual exclusion. But the process whose condition is false must wait for the other to enter and change the turn, even when that other process has no interest in its critical section. Thus progress fails and A holds.

More Concurrency and Synchronization questions

All Concurrency and Synchronization questions →