mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-10-25 06:24:27 +08:00
The runtime answers like libuv 1.51's uv_available_parallelism, which Node's os.availableParallelism() returns: on Linux the CPUs in the process's affinity mask, lowered to a smaller cgroup (v2 cpu.max or v1 CFS) CPU quota; on Darwin hw.activecpu, hw.logicalcpu or hw.ncpu; on Windows GetSystemInfo's processor count; at least 1. WASI answers 1, as the dynamic island does. Parallel programs (tsc-ts --checkers) need it to size their thread pools. Corpus 4598 pins the value against the host's Node.