CS FundamentalsHardGATE CS

A test-and-set spinlock: `while (TestAndSet(&lock)); /* CS */ lock = false;`. Which requirement of the critical-section problem does it NOT guarantee?

  1. A. Mutual exclusion
  2. B. Progress
  3. C. It satisfies all three
  4. D. Bounded waiting

Correct answer: D. Bounded waiting

TestAndSet is atomic, so only one process enters, and a free lock is always taken (progress). But nothing orders the waiters: an unlucky process may lose the race every time, so waiting is unbounded.

More Operating Systems questions

Exams that ask this topic