refactor!: remove delay, timeout, and the timer thread; add async_waker#360
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop-2 #360 +/- ##
=============================================
- Coverage 98.29% 98.15% -0.14%
=============================================
Files 79 76 -3
Lines 3986 3901 -85
=============================================
- Hits 3918 3829 -89
- Misses 68 72 +4
Flags with carried forward coverage won't be shown. Click here to find out more. Continue to review full report in Codecov by Harness.
🚀 New features to boost your workflow:
|
|
An automated preview of the documentation is available at https://360.capy.prtest3.cppalliance.org/index.html If more commits are pushed to the pull request, the docs will rebuild at the same URL. 2026-07-09 16:42:59 UTC |
Delete delay(), timeout(), and detail::timer_service, the background timer thread capy spawned per execution_context. Capy no longer creates any thread the user did not ask for; timed operations belong to the I/O layer, which owns a reactor and a clock. Add async_waker, a single-waiter notification point that replaces the timer thread as the escape hatch: the user provides the thread and the clock, capy provides the suspension point. wake() is callable from any thread and only ever posts through the waiter's executor; a notification with no waiter is latched as a single token so the notify-before-wait race is benign. A three-state atomic is the sole arbiter of the waiter's resume, which makes cross-thread notify safe without locks. wait() requires an executor that resumes continuations on a single thread, the same model as async_event and async_mutex. The quitter tests and the timeout-cancellation, when-any, and awaitable-sender examples are reworked around the new primitive with std::thread. Also fixes two pre-existing awaitable-sender bugs: a dangling executor_ref bound to a temporary executor, and a discarded symmetric-transfer handle that left a wrapped task never running. error::timeout remains; corosio maps its deadline results onto it.
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.
Delete delay(), timeout(), and detail::timer_service, the background timer thread capy spawned per execution_context. Capy no longer creates any thread the user did not ask for; timed operations belong to the I/O layer, which owns a reactor and a clock.
Add async_waker, a single-waiter notification point that replaces the timer thread as the escape hatch: the user provides the thread and the clock, capy provides the suspension point. wake() is callable from any thread and only ever posts through the waiter's executor; a notification with no waiter is latched as a single token so the notify-before-wait race is benign. A three-state atomic is the sole arbiter of the waiter's resume, which makes cross-thread notify safe without locks. wait() requires an executor that resumes continuations on a single thread, the same model as async_event and async_mutex.
The quitter tests and the timeout-cancellation, when-any, and awaitable-sender examples are reworked around the new primitive with std::thread. Also fixes two pre-existing awaitable-sender bugs: a dangling executor_ref bound to a temporary executor, and a discarded symmetric-transfer handle that left a wrapped task never running. error::timeout remains; corosio maps its deadline results onto it.
Related to #351.