From 7c197c7784454b3e78aeddbad102d57f83dd98a4 Mon Sep 17 00:00:00 2001 From: Martin Grigorov Date: Tue, 16 Sep 2025 16:41:18 +0300 Subject: [PATCH] runtime: clarify the edge case of `Builder::global_queue_interval()` (#7605) --- tokio/src/runtime/builder.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tokio/src/runtime/builder.rs b/tokio/src/runtime/builder.rs index 76800296a..3fc3cfe7c 100644 --- a/tokio/src/runtime/builder.rs +++ b/tokio/src/runtime/builder.rs @@ -980,8 +980,10 @@ impl Builder { /// tasks. Setting the interval to a smaller value increases the fairness of the scheduler, /// at the cost of more synchronization overhead. That can be beneficial for prioritizing /// getting started on new work, especially if tasks frequently yield rather than complete - /// or await on further I/O. Conversely, a higher value prioritizes existing work, and - /// is a good choice when most tasks quickly complete polling. + /// or await on further I/O. Setting the interval to `1` will prioritize the global queue and + /// tasks from the local queue will be executed only if the global queue is empty. + /// Conversely, a higher value prioritizes existing work, and is a good choice when most + /// tasks quickly complete polling. /// /// [the module documentation]: crate::runtime#multi-threaded-runtime-behavior-at-the-time-of-writing ///