The document of `Future` lacks the specification to say every calling to `poll` of the same future shall happens-before another
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 119k
- Forks
- 16.1k
- PR merge metrics
- PR metrics pending
Description
Location (URL)
https://doc.rust-lang.org/core/future/trait.Future.html
https://doc.rust-lang.org/std/future/trait.Future.html
Summary
The current document of Future doesn't specify the ordering relationship for every call to Future::poll. This point is especially critical for these runtimes that have the characteristic of stealing tasks for idle threads. According to the signature of poll, whose receiver type is Pin<& mut Self>, which may be used to modify its internal fields, and the next polling might do the same thing or just a read, however, these operations shouldn't contribute to a data race, even though the future is polling again in another thread.
That is, it is plausible to say every previous call to poll() happens-before the subsequent one of the same future in any case. However, this guarantee is lacking in the current document.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Read the Future trait documentation at the core and std URLs, focusing on the Future::poll contract and its wording about repeated polling. Determine the precise ordering guarantee the specification should state, then update both documented locations and verify that the wording consistently describes the intended happens-before relationship.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100