The GATE Grind

GATE 2007 CS – Question 58

Operating System · Concurrency and Synchronization · 2 marks · Multiple choice

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 */
}
  1. Does not ensure mutual exclusion.
  2. Does not ensure bounded waiting.
  3. Requires strict alternation into the critical section.
  4. Does not prevent deadlock, but ensures mutual exclusion.

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

More Concurrency and Synchronization questions

All Concurrency and Synchronization questions →