CS FundamentalsModerateCapgemini · Cognizant GenC

A counting semaphore S is initialised to 3. Five processes each execute wait(S) once, with no signal(S) in between. How many of them are blocked?

  1. A. 1
  2. B. 3
  3. C. 2
  4. D. 5

Correct answer: C. 2

The first three decrement S to 0 and proceed; the remaining two find S <= 0 and block.

More Operating Systems questions

Exams that ask this topic