Skip to content

Commit c27a23c

Browse files
committed
runtime: Clarify the documentation for global_queue_interval=1
If the interval is set to 1 then the schedulers will always execute tasks from the global queue. Tasks from the local queue will be executed only if the global queue is empty. multi_thread scheduler: https://github.com/tokio-rs/tokio/blob/7127e257a7d7025a5f6a62eb8aab81c2191f5cdb/tokio/src/runtime/scheduler/multi_thread/worker.rs#L806-L813
1 parent 7127e25 commit c27a23c

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

tokio/src/runtime/builder.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -980,8 +980,10 @@ impl Builder {
980980
/// tasks. Setting the interval to a smaller value increases the fairness of the scheduler,
981981
/// at the cost of more synchronization overhead. That can be beneficial for prioritizing
982982
/// getting started on new work, especially if tasks frequently yield rather than complete
983-
/// or await on further I/O. Conversely, a higher value prioritizes existing work, and
984-
/// is a good choice when most tasks quickly complete polling.
983+
/// or await on further I/O. Setting the interval to `1` will prioritise the global queue and
984+
/// tasks from the local queue will be executed only if the global queue is empty.
985+
/// Conversely, a higher value prioritizes existing work, and is a good choice when most
986+
/// tasks quickly complete polling.
985987
///
986988
/// [the module documentation]: crate::runtime#multi-threaded-runtime-behavior-at-the-time-of-writing
987989
///

0 commit comments

Comments
 (0)