futures-locks icon indicating copy to clipboard operation
futures-locks copied to clipboard

RwLock needs a task-fair locking policy

Open parasyte opened this issue 5 years ago • 1 comments

Because readers and writers are queued independently, read-heavy workloads will starve writers.

See parking_lot::RwLock for an example implementation that does not have this starvation problem with exclusive access.

parasyte avatar Feb 15 '20 19:02 parasyte

Hm, you're right. I always intended to give writers priority over readers, but now that I review the code I see that I didn't actually do that. Thanks for pointing it out.

asomers avatar Feb 16 '20 19:02 asomers