async/read_write_lock_utils library

Async read/write lock — roadmap #653.

Coordinates a shared resource so many readers run concurrently OR one writer runs exclusively, never both. Unlike AsyncMutexUtils (which serializes everything), this lets reads proceed in parallel and only blocks them around a write — the right primitive for a read-heavy cache or in-memory store.

Writer-preference is the default: once a writer is waiting, new readers queue behind it, so a steady stream of reads can't starve a pending write. Pass writerPreferred: false for reader-preference (max read throughput, at the risk of writer starvation).

Classes

ReadWriteLock
A reader/writer lock with read/write scopes. Reentrancy is NOT supported (acquiring a write inside a read on the same lock will deadlock).