Fix timer fast path starvation when used as a yield point#135
Fix timer fast path starvation when used as a yield point#135sgerbino merged 1 commit intocppalliance:developfrom
Conversation
The already-expired timer fast path used dispatch() which does symmetric transfer on the same thread, resuming the coroutine without yielding to the scheduler. This starved queued work (e.g. sub-tasks spawned via run_async) when a 0ns timer was used as a poll/yield mechanism. Switch to post() + noop_coroutine() so the coroutine enters the scheduler queue, giving other pending work a chance to execute.
📝 WalkthroughWalkthroughThis change modifies the timer service's already-expired timer handling in Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 2✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
No actionable comments were generated in the recent review. 🎉 Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #135 +/- ##
===========================================
+ Coverage 80.93% 81.15% +0.21%
===========================================
Files 64 64
Lines 5666 5667 +1
===========================================
+ Hits 4586 4599 +13
+ Misses 1080 1068 -12
... and 1 file with indirect coverage changes Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
|
An automated preview of the documentation is available at https://135.corosio.prtest3.cppalliance.org/index.html If more commits are pushed to the pull request, the docs will rebuild at the same URL. 2026-02-12 16:11:05 UTC |
|
GCOVR code coverage report https://135.corosio.prtest3.cppalliance.org/gcovr/index.html Build time: 2026-02-12 16:19:33 UTC |
The already-expired timer fast path used dispatch() which does symmetric transfer on the same thread, resuming the coroutine without yielding to the scheduler. This starved queued work (e.g. sub-tasks spawned via run_async) when a 0ns timer was used as a poll/yield mechanism.
Switch to post() + noop_coroutine() so the coroutine enters the scheduler queue, giving other pending work a chance to execute.
Summary by CodeRabbit