Question: Consider the following solution to the critical - section problem for two processes. 5 boolean flag [ 2 ] ; int turn; boolean flag [
Consider the following solution to the criticalsection problem for two processes.
boolean flag ;
int turn;
boolean flag FALSE;
boolean flag FALSE; do flag i true; while flag jif turn flag TRUE; while turn j; flag i TRUE;
CRITICAL SECTION turn j; flag i FALSE; remainder section while
Two process Po and P share the flag and turn variable. The structure of the process Pi or with Pi i or being the other process.
If the initial value of turn is which of the following is TRUE, about the above solution?
The proposed solution fails to guarantee mutual exclusion.
This solution guarantee mutual exclusion and prevent deadlock.
This solution fails to prevent deadlock.
This solution fails to guarantee mutual exclusion and fails to prevent deadlock
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
