CS FundamentalsHardGATE CS

Two processes each run `while (flag[j]); flag[i] = true; CS; flag[i] = false;` (check first, then set). Which property fails?

  1. A. Mutual exclusion: both can see the other's flag false and enter together
  2. B. Progress only
  3. C. Bounded waiting only
  4. D. None; it is correct

Correct answer: A. Mutual exclusion: both can see the other's flag false and enter together

Checking before setting leaves a window: both read false, both set true, and both enter the critical section. Swapping the order (set then check) gives the deadlock-prone version instead.

More Operating Systems questions

Exams that ask this topic