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

Make Semaphores fair. #1488

Merged
merged 1 commit into from Dec 6, 2019
Merged

Make Semaphores fair. #1488

merged 1 commit into from Dec 6, 2019

Conversation

jamadden
Copy link
Member

@jamadden jamadden commented Dec 6, 2019

Preserve order of wakeups. Take steps to avoid going back to the O(n^2) old behaviour, though, much like Greenlet does.

This means we auto-unlink links as we call them. Most users won't notice as that's a very low-level method, but baseserver.py was relying on the same rawlink being called every time a semaphore became ready. That was a lot (~once per request) so this eliminates a lot of needless calls.

Fixes #1487

Preserve order of wakeups. Take steps to avoid going back to the O(n^2) old behaviour, though, much like Greenlet does.

This means we auto-unlink links as we call them. Most users won't notice as that's a very low-level method, but baseserver.py was relying on the same rawlink being called every time a semaphore became ready. That was *a lot*, so this eliminates some calls.
@jamadden jamadden merged commit 6115e43 into master Dec 6, 2019
@jamadden jamadden deleted the issue1487 branch December 6, 2019 22:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Semaphore terribly unfair
1 participant