Skip to content

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 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
@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
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