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?
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
GATE 2016 CS (CS2) Q59– A nonnegative counting semaphore S uses P (decrement, blocking if unavailable) and V…
GATE 2012 CS (CS1) Q42– Fetch And Add(L,i) atomically returns old L and increments L by i. Shared unsigned L…
GATE 2013 CS (CS1) Q44– x initially zero is shared by W,X,Y,Z. Each process waits on counting semaphore S=2, reads…
GATE 2013 CS (CS1) Q49– X computes a[i]=f(i), then ExitX(R,S), for i=0,…,n−1. Y calls EntryY(R,S), then computes…
GATE 2010 CS (CS1) Q33– Shared Boolean S1,S2 start with arbitrary values. P1 waits while S1==S2, enters its…
GATE 2010 CS (CS1) Q55– Binary semaphores S0,S1,S2 start at 1,0,0. Concurrent processes execute: How many times is…