CS FundamentalsHardGATE CS

A spin lock is built from an atomic test-and-set: while (TestAndSet(&lock)) ; /* critical section */ lock = false;. Which property does it NOT guarantee on a multiprocessor?

  1. A. Mutual exclusion
  2. B. Progress
  3. C. Atomicity of acquiring the lock
  4. D. Bounded waiting

Correct answer: D. Bounded waiting

Whichever spinner's test-and-set happens to win after a release gets the lock, so one thread can lose indefinitely: no bounded waiting. Mutual exclusion and progress hold; a ticket lock or a queue of waiters adds fairness.

More Operating Systems questions

Exams that ask this topic