CS FundamentalsHardGATE CS

In the first readers-writers solution (readers share a count; the first reader locks out writers and the last reader lets them in), what can happen under a steady stream of overlapping readers?

  1. A. Readers can starve, because a waiting writer always gets priority over them
  2. B. Writers can starve, because a new reader enters while others are still reading
  3. C. A reader and a writer can be in the critical section together
  4. D. Deadlock between the first reader and a writer waiting on the same semaphore

Correct answer: B. Writers can starve, because a new reader enters while others are still reading

Once one reader holds the writer lock, more readers keep joining without waiting, so the count may never fall to zero and writers wait forever. The second variant gives writers priority and can starve readers instead.

More Operating Systems questions

Exams that ask this topic