Enhance documentation on wake call memory ordering#154401
Conversation
|
rustbot has assigned @Mark-Simulacrum. Use Why was this reviewer chosen?The reviewer was selected based on:
|
This comment has been minimized.
This comment has been minimized.
|
Reminder, once the PR becomes ready for a review, use |
|
In general I would say that this documentation makes more sense on the I would also relax the wording a bit. You use the word 'runtime must' and so on, but I think it would be useful to instead phrase it along the lines of 'to avoid missed wakeups, the runtime must' or similar to make it clear what the consequences of getting it wrong are. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
| /// the beginning of the invocation of `poll`. | ||
| /// In particular, this means that if a task self-wakes (invokes `wake` on itself during `poll`), |
There was a problem hiding this comment.
It looks like you intended to have a newline here, but markdown will not treat this as a newline.
Please either reflow without a line break or add an empty line if you want two paragraphs. (I probably would keep one paragraph.)
| /// current task again. | ||
| /// | ||
| /// To avoid missed wakeups, the runtime must ensure that for any call to `wake`, | ||
| /// there is a subsequent call to `poll` such that the returned `wake` _happens-before_ |
There was a problem hiding this comment.
Saying "returned wake" sounds like a value called wake is being returned, but that is not the case. Can you reword?
There was a problem hiding this comment.
Is "returning from the wake happens-before ..." good enough? Or, option B
there is a subsequent call to
pollsuch that thewake()return happens-before
There was a problem hiding this comment.
It's probably sufficient to say that "the call to wake() happens-before the beginning of the call to poll()".
There was a problem hiding this comment.
It is generally a bad idea to create PRs from your main branch. Always create a new branch in your repo for every PR.
It is however not necessary to make a new PR, you can just force-push to that branch to remove the bad changes.
|
This PR changes rustc_public cc @oli-obk, @celinval, @ouz-a, @makai410 The run-make-support library was changed cc @jieyouxu
cc @rust-lang/miri
cc @rust-lang/clippy |
This comment has been minimized.
This comment has been minimized.
Add memory ordering guarantees for wake and poll calls.
Clarify wake behavior in documentation regarding missed wakeups.
Clarify wakeup requirements for the executor in documentation.
|
This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
|
The job Click to see the possible cause of the failure (guessed by this bot) |
View all comments
Add documentation about memory ordering requirements for wake calls. Try to fix #128920