🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← Quiz: Semaphores and Classic Problems: all 9 questions

Quiz: Semaphores and Classic Problems · Question 6 of 9

In the readers-first readers-writers solution, which reader performs wait(rw)?

In the readers-first readers-writers solution, which reader performs wait(rw)?

  1. A.Every reader
  2. B.Only the first reader to arrive while no other reader is reading
  3. C.Only the last reader
  4. D.No reader — only writers use rw
Answer & explanation

Correct answer: Only the first reader to arrive while no other reader is reading

The first reader locks writers out on behalf of the whole group of readers.

Can you get the rest right without peeking?

Take the timed Quiz: Semaphores and Classic Problems quiz free. Pass it to earn XP and count towards your certificate.

Start the quiz →