Consider the methods used by processes P1 and P2 for accessing their critical…

GATE · 2010 · CS · Computer Science & IT

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 P1Method used by P2while (S1 == S2);while (S1 != S2);Critical SectionCritical SectionS1 = S2;S2 = not(S1);\begin{array}{|l|l|}\hline \textbf{Method used by P1} & \textbf{Method used by P2} \\ \hline \text{while (S1 == S2);} & \text{while (S1 != S2);} \\ \text{Critical Section} & \text{Critical Section} \\ \text{S1 = S2;} & \text{S2 = not(S1);} \\\hline \end{array}

Which one of the following statements describes the properties achieved?

  1. A.

    Mutual exclusion but not progress

  2. B.

    Progress but not mutual exclusion

  3. C.

    Neither mutual exclusion nor progress

  4. D.

    Both mutual exclusion and progress

Attempted by 571 students.

Sign up free to check your answer

Sign up free

Explore the full course: Gate Guidance By Sanchit Sir

Loading lesson…