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

Handle spurious wakeups #740

Merged
merged 3 commits into from
Feb 28, 2024
Merged

Conversation

ibeckermayer
Copy link
Contributor

Updates the tutorial to handle spurious wakeups. Continuation from discussion in #739

Playground

Isaiah Becker-Mayer added 2 commits December 16, 2023 19:52
that handles spurious wakeups.
Copy link
Contributor

@hds hds left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your PR!

I've got a couple of suggestions in the text. Feel free to take them or leave them.

Co-authored-by: Hayden Stainsby <hds@caffeineconcepts.com>
@ibeckermayer ibeckermayer requested a review from hds January 18, 2024 18:32
}

fn poll(&mut self, cx: &mut Context<'_>) {
// Spurious wake-ups are allowed, even after a future has
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it might be worth linking to wherever in the std::future documentation it explains that the future trait contract allows spurious wakeups?

Copy link
Contributor Author

@ibeckermayer ibeckermayer Jan 19, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not actually sure where that's documented, and didn't find anything with a quick search of the obvious candidates. It may be implied by other documentation, or just "common knowledge".

I only became aware of it because @Darksonn commented such on a previous PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hawkw any thoughts on the above 👆? Otherwise this is good to go 🚀

@Darksonn Darksonn merged commit 278a2b1 into tokio-rs:master Feb 28, 2024
6 checks passed
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.

4 participants