Skip to main content

Module threading

Module threading 

Source
Expand description

Thread-count selection helpers.

Constants§

AVAILABLE_PARALLELISM_FALLBACK
Assumed parallelism when available_parallelism is unavailable.
DEBUG_STACK_SIZE
Stack size for debug-build threads with deep density-function call chains.

Functions§

available_worker_threads
Returns the host’s available parallelism, or AVAILABLE_PARALLELISM_FALLBACK.
worker_threads_for_available
Caps an explicit positive worker count to available parallelism, or uses half the available threads with a minimum target of two.