Skip to main content

DEFAULT_WORKER_STACK_BYTES

Constant DEFAULT_WORKER_STACK_BYTES 

Source
pub const DEFAULT_WORKER_STACK_BYTES: usize = _; // 16_777_216usize
Expand description

Stack size reserved for every Tenferro CPU worker thread.

Rust’s std::thread default is 2 MiB, but provider code can recurse with large private frames: a NUM_THREADS=64 OpenBLAS build keeps a job_t job[64] (about 541 KiB per level, measured) on the stack of every recursive dgetrf_parallel frame, so 2 MiB allowed only three levels and aborted with a stack overflow at n>=256. Sixteen MiB leaves room for about thirty such frames, which is the order of the 8 MiB main-thread default that provider calls receive outside a pool.

Override it per context with CpuContext::with_threads_and_worker_stack, or for the environment-configured path with the TENFERRO_CPU_WORKER_STACK_BYTES environment variable.