Merged
Conversation
5c632a1 to
0d4780c
Compare
mkroening
approved these changes
Aug 23, 2022
Member
mkroening
left a comment
There was a problem hiding this comment.
Looks good to me!
Thanks a lot for your effort of migrating to the generic futex-based impls in std. :)
Member
|
bors try |
Contributor
tryBuild succeeded: |
stlankes
reviewed
Aug 29, 2022
Contributor
stlankes
left a comment
There was a problem hiding this comment.
Excuse me for the late review. I was ill. Like @mkroening, I have the same question __sys_futex_wait.
The rest looks good for me! Thank you for your great support.
Contributor
Author
|
I've now clarified the timeout behaviour in the documentation. Also, |
Contributor
This was referenced Sep 4, 2022
GuillaumeGomez
added a commit
to GuillaumeGomez/rust
that referenced
this pull request
Sep 9, 2022
Use futex-based locks and thread parker on Hermit [Hermit now has futex syscalls](hermit-os/kernel#534), which means Hermit can share the well-tested and performant locks and thread parker used on Linux. Ping `@mkroening,` `@stlankes` r? `@m-ou-se`
This file contains hidden or 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
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.
Futexes greatly simplify the creation of synchronization primitives (see
std's mutex). They are here implemented by using a hashmap, in which the handles to waiting threads are stored, keyed with the address of the futex they are waiting on.I prioritised readability over performance in this PR, faster implementations would use finer grained locking and would not need to allocate the queues. It should be performant enough for most purposes however.