Skip to main content

Module runtime

Module runtime 

Source
Expand description

Tokio runtime helpers.

SP-concurrency-baseline §5.1 — default_worker_threads() chooses a sensible default for ATD reference binaries: min(available_parallelism, 4), overridable via ATD_WORKER_THREADS env. The 4-thread cap prevents a reference binary launched on a 32-core dev machine from spawning 32 idle worker threads per process (adopter test suites that spin up several ref-server instances would otherwise pay 100s of idle threads).

Functions§

default_worker_threads
Returns the recommended tokio worker_threads count for an ATD server binary. Reads ATD_WORKER_THREADS if set; otherwise defaults to min(available_parallelism, 4), falling back to 2 if the OS query fails.