-
Notifications
You must be signed in to change notification settings - Fork 31
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
A lock-free bounded queue #83
Closed
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3bee128
to
79f3692
Compare
79f3692
to
d6bc981
Compare
d6bc981
to
98804fa
Compare
lyrm
reviewed
Oct 20, 2023
d4b7e51
to
e548e50
Compare
This was referenced Nov 3, 2023
0084799
to
2aae21c
Compare
261eabb
to
928660b
Compare
12a77c7
to
46c2cae
Compare
b47847c
to
3749cbf
Compare
3749cbf
to
5e7d637
Compare
FYI, I will squash this PR to a single commit to make this PR a little bit easier to work with. |
734c367
to
47cdeb1
Compare
47cdeb1
to
4accc07
Compare
4accc07
to
3f75aea
Compare
3f75aea
to
5565737
Compare
01f316b
to
55485fd
Compare
55485fd
to
72af6bf
Compare
FYI, I changed this to use Picos instead of DLA. |
lyrm
reviewed
Nov 14, 2024
lyrm
added a commit
that referenced
this pull request
Nov 23, 2024
* Bounded queue from PR #83 : remove blocking part * Add tests * Add drop_exn, is_full and of_list_exn function. * Add benches * Add examples in doc.
#160 has been merged and adds this implementation without the bounding part. For now, we are not planning to add a dependency to picos so I close this PR. Thanks @polytypic for the work ! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This implements a lock-free bounded queue — blocking using domain-local-await.
The data structure / algorithm is based on the Michael-Scott queue extended with length maintenance and caching of remaining capacity in such a way that additional contention is avoided in the happy paths.
TODO:
try_push
,length
(can be done inO(1)
),is_empty