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

Add a semaphore implementation Sem using Awaitable #344

Merged
merged 1 commit into from
Jan 26, 2025
Merged

Conversation

polytypic
Copy link
Collaborator

@polytypic polytypic commented Jan 24, 2025

This adds a low overhead and optimistic semaphore implementation Sem that supports poisoning using the Awaitable abstraction. This seems to outperform the previous Semaphore implementation, probably due to optimistic use of fetch_and_add, and also requires less code as the queue management is done by Awaitable.

@polytypic polytypic force-pushed the add-sem branch 22 times, most recently from 2814cfa to b7cfd21 Compare January 26, 2025 15:08
@polytypic polytypic marked this pull request as ready for review January 26, 2025 15:08
@polytypic polytypic force-pushed the add-sem branch 2 times, most recently from 8e77671 to 862bcbd Compare January 26, 2025 16:04
@polytypic polytypic merged commit 1da7d08 into main Jan 26, 2025
6 checks passed
@polytypic polytypic deleted the add-sem branch January 26, 2025 16:31
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.

1 participant