Skip to main content

Module core_width

Module core_width 

Source
Expand description

Process-wide core width for executor parallelism decisions.

Sizing parallel executor work from std::thread::available_parallelism() at the call site is wrong on a pinned thread: it reads the CALLING thread’s affinity mask, so a runtime worker pinned to a single core under serve-core confinement reports 1 and every parallel decision collapses to serial. That is how serving-mode Grace joins ran serially long after the parallel path existed. The width here has no such failure: the launcher resolves it once at startup from an unpinned context and publishes it.

Functions§

process_core_width
The process’s core budget for executor parallelism.
set_process_core_width
Publish the process’s core budget. Called once at startup by the launcher (waratah_bin) after serve-core resolution: the serve core set size when the process is confined, the machine width otherwise (read from the unpinned main thread). Idempotent: the first call wins.