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?
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
GATE 2010 CS (CS1) Q55– Binary semaphores S0,S1,S2 start at 1,0,0. Concurrent processes execute: How many times is…
GATE 2015 CS (CS3) Q31– Shared varP,varQ start false. These loops deliberately put the critical sections INSIDE…
GATE 2026 CS (CS2) Q51– Consider three processes P 1, P 2, and P 3 running identical code shown below. A and B are…
GATE 2024 CS (CS1) Q40– Two threads T1 (a=a+1; b=b+1;) and T2 (b=2*b; a=2*a;) update shared variables a and b,…
GATE 2024 CS (CS2) Q46– Consider a multi-threaded program with two threads T1 and T2 sharing semaphores s1…
GATE 2023 CS Q38– Consider the two functions incr and decr shown below. There are 5 threads each invoking…