Implement thread parking for xous#116839
Merged
bors merged 2 commits intorust-lang:masterfrom Nov 29, 2023
Merged
Conversation
xobs
reviewed
Oct 18, 2023
Contributor
xobs
left a comment
There was a problem hiding this comment.
Just need to make the one change, and I think it's good to merge.
It's very similar to a local patch I'm carrying while trying to debug threading issues. I have this particular patch disabled in my local branch in order to eliminate potential issues with condvars. Thread parking improves features such as channels, so I think this is good to merge.
8c7a62d to
03301f2
Compare
Member
Author
|
I forgot about the free message... There shouldn't be any waiting threads, but it's probably best to let the ticktimer server destroy the table entries. |
Collaborator
|
The Miri subtree was changed cc @rust-lang/miri |
Member
Author
|
Sorry, wrong branch 🤦 |
0118d4a to
2dc6ba2
Compare
Member
|
@bors r+ |
Collaborator
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Nov 29, 2023
…iaskrgr Rollup of 7 pull requests Successful merges: - rust-lang#116839 (Implement thread parking for xous) - rust-lang#118265 (remove the memcpy-on-equal-ptrs assumption) - rust-lang#118269 (Unify `TraitRefs` and `PolyTraitRefs` in `ValuePairs`) - rust-lang#118394 (Remove HIR opkinds) - rust-lang#118398 (Add proper cfgs in std) - rust-lang#118419 (Eagerly return `ExprKind::Err` on `yield`/`await` in wrong coroutine context) - rust-lang#118422 (Fix coroutine validation for mixed panic strategy) r? `@ghost` `@rustbot` modify labels: rollup
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Nov 29, 2023
…iaskrgr Rollup of 7 pull requests Successful merges: - rust-lang#116839 (Implement thread parking for xous) - rust-lang#118265 (remove the memcpy-on-equal-ptrs assumption) - rust-lang#118269 (Unify `TraitRefs` and `PolyTraitRefs` in `ValuePairs`) - rust-lang#118394 (Remove HIR opkinds) - rust-lang#118398 (Add proper cfgs in std) - rust-lang#118419 (Eagerly return `ExprKind::Err` on `yield`/`await` in wrong coroutine context) - rust-lang#118422 (Fix coroutine validation for mixed panic strategy) r? `@ghost` `@rustbot` modify labels: rollup
rust-timer
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Nov 29, 2023
Rollup merge of rust-lang#116839 - joboet:xous_thread_parking, r=m-ou-se Implement thread parking for xous This follows the pattern set by [the Windows parker](https://github.com/rust-lang/rust/blob/ddef56d5dfa18f169af9db912dc8e8343797eebb/library/std/src/sys/windows/thread_parking.rs) when it uses keyed events. An atomic variable is used to track the state and optimize the fast path, while notifications are send via the ticktime server to block and unblock the thread. ping `@xobs` `@rustbot` label +T-libs +A-atomic r? libs
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.
This follows the pattern set by the Windows parker when it uses keyed events. An atomic variable is used to track the state and optimize the fast path, while notifications are send via the ticktime server to block and unblock the thread.
ping @xobs
@rustbot label +T-libs +A-atomic
r? libs