Skip to main content

Module par

Module par 

Source
Expand description

Splitting work across threads.

This is the plain version the reference kernels use: scoped threads per call and a shared counter that hands out tasks in order. The pinned worker groups from spec/10-cpu.md replace it when the plan executor lands. Nothing a task computes may depend on which thread runs it, which is what keeps the kernels deterministic under any thread count.

Structs§

Shared
A buffer many threads write into at once, each to elements no other thread touches.

Functions§

available
The number of threads the machine offers.
for_each
Runs f(i) for every i in 0..n on up to threads threads.
map
(0..n).map(f).collect() on up to threads threads, in order.