Skip to main content

cpu_pool

Function cpu_pool 

pub fn cpu_pool() -> &'static ThreadPool
Expand description

The process-wide CPU pool: one named thread (tilo-cpu-N) per core.

Use it directly (cpu_pool().install(|| items.par_iter()…)) for data-parallel work from a synchronous thread; from async code, use cpu().

§Panics

When the OS refuses to start the pool’s threads.

In a browser the pool is the page thread alone: install and parallel iterators run sequentially on the caller.