[codex] add async tasklet waker#406
Open
xuchang-vivo wants to merge 1 commit into
Open
Conversation
e3c4641 to
20a23a3
Compare
Contributor
Author
|
build_prs |
|
Job is started, see https://github.com/vivoblueos/kernel/actions/runs/25146859694. |
|
✅ All jobs completed successfully, see https://github.com/vivoblueos/kernel/actions/runs/25146859694. |
Contributor
|
pls add async design in book. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Tasklet State Model
The async executor tracks two things for each tasklet: whether it is currently linked in
ASYNC_WORK_QUEUE, and the tasklet scheduling state.stateDiagram-v2 [*] --> IDLE: created IDLE --> QUEUED: wake and enqueue QUEUED --> POLLING: pop from queue and poll POLLING --> IDLE: pending and not woken POLLING --> WOKEN: woken during poll WOKEN --> QUEUED: requeue after pending POLLING --> COMPLETED: ready COMPLETED --> [*]: no Arc refs remainQueue ownership by state:
IDLEQUEUEDPOLLINGWOKENPending.COMPLETEDReadyand will not be scheduled again.pop_front()does not destroy the tasklet. It transfers the list-ownedArc<Tasklet>into the localtaskvariable inpoll_inner(). If the future storescx.waker(), that waker also owns anArc<Tasklet>, so future events can schedule the same tasklet again.Validation