🎙 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 7 of 10

In the producer–consumer solution, when does the producer block on wait(empty)?

In the producer–consumer solution, when does the producer block on wait(empty)?

  1. A.When the buffer is empty
  2. B.When the buffer is full (no free slots left)
  3. C.When the consumer is running
  4. D.Never
Answer & explanation

Correct answer: When the buffer is full (no free slots left)

empty counts free slots; when it reaches 0, there is no room for a new item.

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 →