Explain the readers-writers problem and the trade-offs between reader-preference and writer-preference solutions.

Last updated 5 July 2026

  • Readers-writers: many readers may access shared data concurrently, but a writer needs exclusive access from all readers and writers.

  • Reader-preference lets new readers join while any reader is active: high read throughput, but writers can starve and data may go stale.

  • Writer-preference blocks new readers once a writer waits: data stays current, but readers can starve. Fair solutions serve requests in arrival order (via a turnstile semaphore) so neither starves.

  • https://growthequityinterviewguide.com/firms/b-capital
  • https://www.interviewbit.com/sre-interview-questions/
All Operating Systems interview questions