Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rt: coop should yield using waker defer strategy #7185

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

carllerche
Copy link
Member

@carllerche carllerche commented Feb 27, 2025

PR #5223 introduces a waker defer list to handle yielding tasks. This defer list enables the runtime to poll the driver between yields. Previously, the coop path did not use the defer yield path, preventing the runtime driver from being checked. This PR updates the coop yield logic to use the defer strategy.

Merging this PR should be coordinated with #7164.

PR #5223 introduces a waker defer list to handle yielding tasks. This defer
list enables the runtime to poll the driver between yields. Previously, the
coop path did not use the defer yield path which prevents the runtime driver
from being checked. This PR updates the coop yield logic to use the defer
strategy.
@carllerche carllerche added C-bug Category: This is a bug. A-tokio Area: The main tokio crate M-runtime Module: tokio/runtime labels Feb 27, 2025
@carllerche carllerche requested a review from Darksonn February 27, 2025 17:39
@carllerche
Copy link
Member Author

It looks like the quinn tests are flaky.

@Darksonn Darksonn added the M-coop Module: tokio/coop label Feb 28, 2025
if use_coop {
// Consume a good chunk of budget, which should
// force at least one yield.
for _ in 0..200 {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have a fair number of tests that declare a const BUDGET: usize = 128; constant. It would be good to do the same here so we can grep for tests that assume what the budget is.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-tokio Area: The main tokio crate C-bug Category: This is a bug. M-coop Module: tokio/coop M-runtime Module: tokio/runtime
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants