2dbi
Home/Elastic/Concurrency: Thread-Safe Bounded Cache / Read-Write Lock
EElastic·DSAEngineerDistributed Systems / Concurrency

Concurrency: Thread-Safe Bounded Cache / Read-Write Lock

Problem

Implement a thread-safe cache allowing concurrent reads but exclusive writes (reader-writer lock).

Example

many readers concurrently; writer exclusive

Constraints

  • No starvation; correct under contention

What Elastic looks for

Concurrency-safe code and reasoning about reader-writer trade-offs.

added 6 days ago
LeadersAccount