StreakPeaked· Practice

ExamsGATETechnical

Consider the methods used by processes P1 and P2 for accessing their critical sections whenever needed, as given below. The initial values of shared boolean variables S1 and S2 are randomly assigned. Method used by P1 while (S1 == S2); Critical Section S1 = S2; Method used by P2 while (S1 != S2); Critical Section S2 = not(S1); Which one of the following statements describes the properties achieved?

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

Correct answer: Mutual exclusion but not progress

Solution

The methods used by P1 and P2 ensure that only one process can enter its critical section at a time, achieving mutual exclusion. However, if both processes are waiting for the other to leave its critical section, they can end up in a deadlock situation, which means progress is not guaranteed.

Related GATE Technical questions

⚔️ Practice GATE Technical free + battle 1v1 →