Crate fork_union

Source
Expand description

OpenMP-style cross-platform fine-grained parallelism library.

Fork Union provides a minimalistic cross-platform thread-pool implementation and Parallel Algorithms, avoiding dynamic memory allocations, exceptions, system calls, and heavy Compare-And-Swap instructions. The library leverages the “weak memory model” to allow Arm and IBM Power CPUs to aggressively optimize execution at runtime. It also aggressively tests against overflows on smaller index types, and is safe to use even with the maximal usize values. It’s compatible with the Nightly toolchain and requires the allocator_api feature to be enabled.

Structs§

Prong
Describes a portion of work executed on a specific thread.
SyncConstPtr
Raw const pointer that can cross threads.
SyncMutPtr
Raw mutable pointer that can cross threads.
ThreadPool
Minimalistic, fixed‑size thread‑pool for blocking scoped parallelism.

Enums§

Error

Functions§

for_each_prong_mut
Visit every element exactly once, passing both the Prong (so you know thread_index and task_index) and a mutable reference to that element.
for_each_prong_mut_dynamic
Visit every element exactly once, passing both the Prong (so you know thread_index and task_index) and a mutable reference to that element.
for_n
Distributes n similar duration calls between threads by individual indices.
for_n_dynamic
Executes n uneven tasks on all threads, greedily stealing work.
for_slices
Distributes n similar duration calls between threads in slices.
spawn
Spawns a pool with the default allocator.