Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RwLock needs a task-fair locking policy #34

Open
parasyte opened this issue Feb 15, 2020 · 1 comment
Open

RwLock needs a task-fair locking policy #34

parasyte opened this issue Feb 15, 2020 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@parasyte
Copy link

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.

@asomers
Copy link
Owner

asomers commented Feb 16, 2020

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 asomers added the bug Something isn't working label Feb 16, 2020
@asomers asomers self-assigned this Feb 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants