Skip to main content

default_walk_width

Function default_walk_width 

Source
pub fn default_walk_width() -> usize
Expand description

Slice count for a parallel walk whose caller did not request an explicit worker count: the installed pool’s width, or available_parallelism() when no pool exists. Serving processes install their pool at startup — before any walk can resolve its execution mode — so the value is always the installed width there (including a POOL_THREADS_ENV override). The no-pool branch covers unit tests, batch tools such as waratah import --offline, and embeddings: their run_units fallback spawns one scoped thread per slice, so the machine’s parallelism is the natural width. effective_width cannot be used for this: its no-pool usize::MAX is a “no width limit” report, not a slice count.