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

runtime: make improvements to global_queue_interval #6445

Merged
merged 7 commits into from
Apr 3, 2024

Conversation

mox692
Copy link
Member

@mox692 mox692 commented Mar 31, 2024

Motivation

Resolve #5713. Currently specifying 0 or 1 for global_queue_interval causes a panic.

Solution

This PR:

  • Added documentation indicating that setting global_queue_interval to 0 is not allowed and included an assert in the builder.
  • Removed the debug_assert!(next > 1) that could be triggered when global_queue_interval is set to 1.
    • Although it's still unclear whether there is a practical benefit to always prioritize checking the global queue first, but i guess it's probably better than causing a panic in debug builds.

@mox692 mox692 added A-tokio Area: The main tokio crate M-runtime Module: tokio/runtime labels Mar 31, 2024
@github-actions github-actions bot added 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 labels Mar 31, 2024
@mox692 mox692 requested a review from Darksonn April 2, 2024 15:09
@mox692 mox692 merged commit 328a02c into tokio-rs:master Apr 3, 2024
81 checks passed
@mox692 mox692 deleted the global_queue_interval_improvement branch April 3, 2024 05:10
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-runtime Module: tokio/runtime 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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

rt: consider having runtime::Builder panic if setting global_queue_interval to zero
2 participants