All Questions
Dealing With Contention hard

A standard Reader-Writer lock allows multiple readers or one writer. If readers arrive constantly, what happens to the writer?

  1. A It runs immediately.
  2. B Writer Starvation. The writer waits for the active readers to drain, but new readers keep arriving and taking the shared lock, so the read-count never hits 0.
  3. C The writer joins the readers.
  4. D Deadlock.

One system design question a day, with spaced repetition so the ones you miss come back.

Get the app

Related questions