Consider the methods used by processes P1 and P2 for accessing their c...
It can be easily observed that the Mutual Exclusion requirement is satisfied by the above solution, P1 can enter critical section only if S1 is not equal to S2, and P2 can enter critical section only if S1 is equal to S2. But here Progress Requirement is not satisfied. Suppose when s1=1 and s2=0 and process p1 is not interested to enter into critical section but p2 want to enter critical section. P2 is not able to enter critical section in this as only when p1 finishes execution, then only p2 can enter (then only s1 = s2 condition be satisfied). Progress will not be satisfied when any process which is not interested to enter into the critical section will not allow other interested process to enter into the critical section.
View all questions of this test
Consider the methods used by processes P1 and P2 for accessing their c...
P1 Method:
The P1 method uses a while loop to continuously check if S1 is equal to S2. If they are equal, it enters the critical section and then assigns the value of S2 to S1.
P2 Method:
The P2 method also uses a while loop, but it checks if S1 is not equal to S2. If they are not equal, it enters the critical section and then assigns the negation of S1 to S2.
Analysis:
Let's analyze the properties achieved by these methods.
Mutual Exclusion:
Mutual exclusion means that at any given time, only one process can be in its critical section. In this case, both processes use a while loop to continuously check the values of S1 and S2. If both processes simultaneously enter their while loop, it means that S1 and S2 are equal for both processes. As a result, neither process will be able to enter its critical section, ensuring mutual exclusion.
Progress:
Progress means that if a process is not in its critical section, and there are no other processes in their critical sections, then any process that wants to enter its critical section should be able to do so. In this case, if P1 is not in its critical section, it will keep checking the values of S1 and S2. Similarly, if P2 is not in its critical section, it will also keep checking the values of S1 and S2. Therefore, if either process wants to enter its critical section, it will eventually be able to do so, ensuring progress.
Conclusion:
Based on the analysis above, the methods used by processes P1 and P2 achieve mutual exclusion but not progress. This is because the while loops in both methods create a deadlock situation where neither process can enter its critical section if the values of S1 and S2 are initially equal. In such a case, both processes will keep checking the values indefinitely, resulting in a lack of progress.
Consider the methods used by processes P1 and P2 for accessing their c...
It can be easily observed that the Mutual Exclusion requirement is satisfied by the above solution, P1 can enter critical section only if S1 is not equal to S2, and P2 can enter critical section only if S1 is equal to S2. But here Progress Requirement is not satisfied. Suppose when s1=1 and s2=0 and process p1 is not interested to enter into critical section but p2 want to enter critical section. P2 is not able to enter critical section in this as only when p1 finishes execution, then only p2 can enter (then only s1 = s2 condition be satisfied). Progress will not be satisfied when any process which is not interested to enter into the critical section will not allow other interested process to enter into the critical section.
To make sure you are not studying endlessly, EduRev has designed Computer Science Engineering (CSE) study material, with Structured Courses, Videos, & Test Series. Plus get personalized analysis, doubt solving and improvement plans to achieve a great score in Computer Science Engineering (CSE).