The GATE Grind

GATE 2016 CS (CS2) – Question 58

Operating System · Concurrency and Synchronization · 2 marks · Multiple choice

Shared turn starts at zero. Process 0 waits while turn == 1, enters its critical section, then sets turn = 1. Process 1 waits while turn == 0, enters its critical section, then sets turn = 0. Which is true?

  1. Correct synchronization solution
  2. Violates mutual exclusion
  3. Violates progress
  4. Violates bounded waiting

Practise this question in The GATE Grind →

Show answer and explanation

Correct answer: (C) Violates progress

Explanation

This enforces strict alternation and prevents simultaneous entry. But after process 0 exits it cannot re-enter until process 1 participates, even if process 1 does not want its critical section. A noninterested process can therefore block another, violating progress. Thus C.

More Concurrency and Synchronization questions

All Concurrency and Synchronization questions →