GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||
GeezerVison is showing github.com — gh-109955 : Update state transition comments for asyncio.Task by kristjanvalur · Pull Request #109910 · python/cpython Conversation
|
| # The transition from 2a to 2b happens when __wakeup() is executed, | ||
| # scheduling __step() to be called, leaving _fut_waiter in place. |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
This confuses me. Once __wakeup() executes, it proceeds without waiting to call __step() -- there's no scheduling involved that I can see in the source code (unless the .c extension is different). The call to future.result() immediately produces a value or raises -- it doesn't block (there's no await there). I do think it is possible to enter step 2b without going through 2a when __step() is scheduled directly by __init__(). So maybe it's clearer to say that we go through either 2a or 2b?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
I may have got my wires crossed here, because it is all confusing. Initially, I thought __wakeup() was called directly (futures just calling registered callbacks) and _wakeup scheduling __step,.. But then it turns out that futures schedule their callbacks... I'll have another look.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Yes, you were right. So, there is no 2a or2b anymore just 2.
The main point I'm trying to get across here is that there can be a _fut_waiter present in a done state, i.e. the
mere presence of a _fut_waiter does not indicate that the Task is still blocked. I hope I'm not making this sound more complicated than it is.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
the mere presence of a
_fut_waiterdoes not indicate that the Task is still blocked
Yes, that's crucial information.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Co-authored-by: Adam Turner <[email protected]>
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
I'll merge it now. Thanks!
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Thanks @kristjanvalur for the PR, and @gvanrossum for merging it 🌮🎉.. I'm working now to backport this PR to: 3.11, 3.12. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
…ythonGH-109910) (cherry picked from commit 45cf5b0) Co-authored-by: Kristján Valur Jónsson <[email protected]> Co-authored-by: Adam Turner <[email protected]>
|
GH-109992 is a backport of this pull request to the 3.12 branch. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
GH-109993 is a backport of this pull request to the 3.11 branch. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
…ythonGH-109910) (cherry picked from commit 45cf5b0) Co-authored-by: Kristján Valur Jónsson <[email protected]> Co-authored-by: Adam Turner <[email protected]>
…ython#109910) Co-authored-by: Adam Turner <[email protected]>
…H-109910) (#109993) gh-109955 : Update state transition comments for asyncio.Task (GH-109910) (cherry picked from commit 45cf5b0) Co-authored-by: Kristján Valur Jónsson <[email protected]> Co-authored-by: Adam Turner <[email protected]>
…H-109910) (#109992) gh-109955 : Update state transition comments for asyncio.Task (GH-109910) (cherry picked from commit 45cf5b0) Co-authored-by: Kristján Valur Jónsson <[email protected]> Co-authored-by: Adam Turner <[email protected]>
…ython#109910) Co-authored-by: Adam Turner <[email protected]>
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.