GATE - 2010 | OS | Consider the methods used by processes P1 and P2 for accessing their critical

GATE - 2010 | OS | Consider the methods used by processes P1 and P2 for accessing their critical
Posted on 13-02-2022

GATE - 2010 [Operating System]

Question:

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.

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.

Which one of the following statements describes the properties achieved?

   

A

Mutual exclusion but not progress

B

Progress but not mutual exclusion

C

Neither mutual exclusion nor progress

D

Both mutual exclusion and progress

Solution:

Option (A) is Correct.

In this mutual exclusion is satisfied because at any point of time either S1 = S2 or S1 ≠ S2, but not both.

But here progress is not satisfied because suppose S1 = 1 and S2 = 0 and P1 is not interested to enter into the critical section but P2 wants to enter into the critical section, and P2 will not be able to enter, because until P1 will not enter the critical section, S1 will not become equal to S2.

So if one process does not interested in entering a critical section, will not allow other processes to enter the critical section which is interested. So progress is not satisfied.

Thank You