CS FundamentalsHardGATE CS

A counting semaphore is implemented WITHOUT busy waiting, and its value is −3 at some moment. What does this tell you?

  1. A. Three processes are blocked on the semaphore's waiting queue
  2. B. Three more signal() calls are needed before any process may enter
  3. C. The semaphore has been corrupted, since values cannot be negative
  4. D. Three processes are currently in the critical section

Correct answer: A. Three processes are blocked on the semaphore's waiting queue

In the blocking implementation wait() decrements first and blocks if the value becomes negative, so −n means n waiters. In the busy-waiting textbook definition the value never goes below 0.

More Operating Systems questions

Exams that ask this topic