Consider the methods used by processes and for accessing their critical sections whenever needed, as given below. The initial values of shared boolean variables and are randomly assigned.
Which one of the following statements describes the properties achieved?
View worked solution
Answer: A
To determine which properties are satisfied, let us analyze Mutual Exclusion and Progress individually.
1. Mutual Exclusion
For a process to enter its Critical Section (CS), it must bypass its respective while loop condition:
- For to enter CS, the condition
S1 == S2must be false, which means . - For to enter CS, the condition
S1 != S2must be false, which means .
Since and cannot be true simultaneously, both processes can never be in their critical sections at the same time. Thus, Mutual Exclusion is satisfied.
2. Progress
The progress requirement states that if no process is in its critical section and some processes want to enter, then only those processes not in their remainder section can participate in deciding which process enters next, and this decision cannot be postponed indefinitely.
Let us test this with an scenario:
- Suppose the initial values are and .
- Process wants to enter its critical section. It tests the condition
S1 == S2, which evaluates totrue == true(true). Thus, gets blocked in thewhileloop. - If process is currently in its remainder section and has no interest in entering its critical section, it will not execute its code.
- Since is inactive, the values of and remain unchanged. Consequently, is blocked indefinitely by a process () that is not even competing for the critical section.
Since an uninterested process can block another process from entering the critical section, Progress is not satisfied.
Conclusion
The system achieves Mutual exclusion but not progress, which corresponds to option A.
Free practice · Your answers on this page are not saved.
