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

sync, coop: apply cooperative scheduling to sync::broadcast::Receiver #6870

Merged

Conversation

tglane
Copy link
Contributor

@tglane tglane commented Sep 26, 2024

Motivation

Similar to #6846 the function sync::broadcast::Receiver::recv utilize cooperative scheduling to prevent that a task could block the runtime.

Solution

I added the usage of runtime::coop::Coop that was added in #6846 to the function so that takes part in the coop budget.

Closes #6855.

@github-actions github-actions bot added the R-loom-sync Run loom sync tests on this PR label Sep 26, 2024
@Darksonn Darksonn added A-tokio Area: The main tokio crate M-sync Module: tokio/sync M-coop Module: tokio/coop labels Sep 26, 2024
Copy link
Contributor

@Darksonn Darksonn left a comment

Choose a reason for hiding this comment

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

Thanks, this is great!

@Darksonn Darksonn merged commit 21df16d into tokio-rs:master Sep 26, 2024
86 checks passed
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-sync Module: tokio/sync R-loom-sync Run loom sync tests on this PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

make broadcast::Receiver cooperative
2 participants