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

Possible Problems When Waking with a Stale Waker #4

Open
cwfitzgerald opened this issue Oct 4, 2020 · 1 comment
Open

Possible Problems When Waking with a Stale Waker #4

cwfitzgerald opened this issue Oct 4, 2020 · 1 comment
Labels
bug Something isn't working question Further information is requested

Comments

@cwfitzgerald
Copy link
Member

consider these events:

- spawn
- poll; waker is saved elsewhere
- wake_by_ref with saved waker
- poll; waker is ignored
- wake_by_ref with saved waker

the second wake_by_ref will be dropped on the floor. Is this a problem? Can real futures do this? Is this supported by existing runtimes?

@cwfitzgerald cwfitzgerald added bug Something isn't working question Further information is requested labels Oct 4, 2020
@Ralith
Copy link
Contributor

Ralith commented Aug 10, 2024

The fundamental rule of implementing a future is "never return Pending without saving the waker". If the second poll returns Pending, then the latest waker must have been saved. An out-of-date waker is necessarily one that the future is no longer interested in, since it didn't poll it since (potentially) acquiring a new waker.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants