From dffcd031d00d2da135a7b2075de9e06d298af574 Mon Sep 17 00:00:00 2001 From: Eliza Weisman Date: Thu, 16 Apr 2026 12:24:51 -0700 Subject: [PATCH] let's see what happens if i just... --- tokio/src/runtime/blocking/sharded_queue.rs | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/tokio/src/runtime/blocking/sharded_queue.rs b/tokio/src/runtime/blocking/sharded_queue.rs index 2fcc925c4..a0a7d8162 100644 --- a/tokio/src/runtime/blocking/sharded_queue.rs +++ b/tokio/src/runtime/blocking/sharded_queue.rs @@ -22,13 +22,16 @@ use std::time::Duration; use super::pool::Task; -/// Number of shards. Must be a power of 2. -/// Under loom, use a single shard to keep the state space tractable — -/// the concurrency properties we need to verify (condvar signaling, -/// shutdown ordering) are independent of shard count. -#[cfg(not(loom))] -const NUM_SHARDS: usize = 16; -#[cfg(loom)] +// TODO(eliza): make this configurable and swap between 1/16 shards based on +// whether the runtime builder enables the sharded queue... +// +// /// Number of shards. Must be a power of 2. +// /// Under loom, use a single shard to keep the state space tractable — +// /// the concurrency properties we need to verify (condvar signaling, +// /// shutdown ordering) are independent of shard count. +// #[cfg(not(loom))] +// const NUM_SHARDS: usize = 16; +// #[cfg(loom)] const NUM_SHARDS: usize = 1; /// A single shard containing a queue protected by its own mutex.