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

coop: expose coop as a public module #7116

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

Conversation

maminrayej
Copy link
Member

This PR makes the coop module public and exposes the has_budget_remaining function.

The motivation for this is to make select! budget-aware (see #7108). The exposed functionality is also useful when dealing with a combination of budget-aware and non-budget-aware futures.

Related to #7111.

@maminrayej maminrayej added A-tokio Area: The main tokio crate M-coop Module: tokio/coop labels Jan 21, 2025
@github-actions github-actions bot added R-loom-current-thread Run loom current-thread tests on this PR R-loom-multi-thread Run loom multi-thread tests on this PR R-loom-multi-thread-alt Run loom multi-thread alt tests on this PR R-loom-sync Run loom sync tests on this PR labels Jan 21, 2025
@github-actions github-actions bot removed R-loom-sync Run loom sync tests on this PR R-loom-multi-thread-alt Run loom multi-thread alt tests on this PR R-loom-multi-thread Run loom multi-thread tests on this PR R-loom-current-thread Run loom current-thread tests on this PR labels Jan 21, 2025
@maminrayej maminrayej added the M-runtime Module: tokio/runtime label Jan 21, 2025
tokio/tests/coop_budget.rs Outdated Show resolved Hide resolved
tokio/src/runtime/coop.rs Outdated Show resolved Hide resolved
tokio/src/runtime/coop.rs Show resolved Hide resolved
@github-actions github-actions bot added R-loom-current-thread Run loom current-thread tests on this PR R-loom-multi-thread Run loom multi-thread tests on this PR R-loom-multi-thread-alt Run loom multi-thread alt tests on this PR R-loom-sync Run loom sync tests on this PR labels Jan 22, 2025
@@ -94,7 +94,7 @@ impl CopyBuffer {
feature = "time",
))]
// Keep track of task budget
let coop = ready!(crate::runtime::coop::poll_proceed(cx));
let coop = ready!(crate::task::coop::poll_proceed(cx));
Copy link
Contributor

Choose a reason for hiding this comment

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

You don't necessarily have to change the internal references - that makes it harder to review.

tokio/src/task/mod.rs Outdated Show resolved Hide resolved
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 M-coop Module: tokio/coop M-runtime Module: tokio/runtime R-loom-current-thread Run loom current-thread tests on this PR R-loom-multi-thread Run loom multi-thread tests on this PR R-loom-multi-thread-alt Run loom multi-thread alt tests on this PR R-loom-sync Run loom sync tests on this PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants