GATE 2007 CS – Question 58
Two processes share wants1, wants2, initially false, and use the following construct. Which is TRUE?
P1: while(true) {
wants1=true; while(wants2==true);
/* critical section */ wants1=false;
/* remainder section */
}
P2: while(true) {
wants2=true; while(wants1==true);
/* critical section */ wants2=false;
/* remainder section */
}Practise this question in The GATE Grind →
Show answer and explanation
Correct answer: (D) Does not prevent deadlock, but ensures mutual exclusion.
Explanation
We are sorry we couldn't write detailed soluition for this, we are working on it!, please consider asking your own AI, its just 2-3 clicks with very minimum effort