Mutual exclusion but not progress - Operating System

Q.  Let P1 and P2 be the two processes and S1 and S2 be the two shared Boolean variables. The initial values of S1 and S2 are randomly assigned. For accessing the critical sections of P1 and P2 the methods used by them are given below:

Method used by P1
While ( S1 == S2 );
Critical section
S1 = S2;

Method used by P2
While ( S1! = S2 )
Critical section
S2  = not (S1);

Which statement / s describes that the properties are achieved?

- Published on 27 Aug 15

a. Progress but not mutual exclusion
b. Mutual exclusion but not progress
c. Both mutual exclusion and progress
d. Neither mutual exclusion nor progress

ANSWER: Mutual exclusion but not progress
 

    Discussion

  • Nirja Shah   -Posted on 12 Nov 15
    - From the above solution it can be easily observed that the Mutual Exclusion requirement is satisfied, P1 can enter the critical section only if S1 is not equal to S2, and P2 can enter critical section only if S1 is equal to S2.

    - Progress Requirement is not satisfied.

    - Definition of Progress Requirement
    If no process is executing in its critical section and there exist some processes that wishes to enter their critical section, then the selection of the processes that will enter the critical section next cannot be postponed indefinitely.

    - If P1 or P2 want to re-enter the critical section, then they cannot even if there is other process running in critical section.

Post your comment / Share knowledge


Enter the code shown above:

(Note: If you cannot read the numbers in the above image, reload the page to generate a new one.)