All Questions
Dealing With Contention medium

If you use a Semaphore with 5 permits to protect a database connection pool, what happens when the 6th thread tries to acquire?

  1. A It crashes.
  2. B It blocks (waits) until a permit is released.
  3. C It creates a new connection.
  4. D It steals a permit.

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

Get the app

Related questions