🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← Quiz: Process Synchronization: all 10 questions

Quiz: Process Synchronization · Question 6 of 10

A semaphore S starts at 2. Three processes call wait(S) one after another, and nobody calls signal(S). What happens?

A semaphore S starts at 2. Three processes call wait(S) one after another, and nobody calls signal(S). What happens?

  1. A.All three continue
  2. B.The first two continue and the third blocks
  3. C.Only the first continues
  4. D.All three block
Answer & explanation

Correct answer: The first two continue and the third blocks

Each successful wait lowers S by 1; when S reaches 0, the next wait blocks.

Can you get the rest right without peeking?

Take the timed Quiz: Process Synchronization quiz free. Pass it to earn XP and count towards your certificate.

Start the quiz →