CS FundamentalsHardAccenture · Capgemini technical pattern

In a two-process mutual-exclusion attempt, each process sets its own flag to true and then waits while the other’s flag is true; there is no turn variable (as in Peterson’s algorithm). What can go wrong?

  1. A. Both may enter the critical section together
  2. B. Both may set their flags at the same time and then wait for each other forever
  3. C. One process can enter twice while the other waits forever, but no deadlock is possible
  4. D. Nothing; flags alone are enough for two processes

Correct answer: B. Both may set their flags at the same time and then wait for each other forever

Mutual exclusion holds (a process enters only after seeing the other’s flag false), but if both set their flags before either checks, each waits for the other: deadlock, violating progress. Peterson adds “turn” so one of them always gives way.

More Operating Systems questions

Exams that ask this topic