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.
- Sync
Const Ptr - Raw const pointer that can cross threads.
- Sync
MutPtr - Raw mutable pointer that can cross threads.
- Thread
Pool - Minimalistic, fixed‑size thread‑pool for blocking scoped parallelism.
Enums§
Functions§
- for_
each_ prong_ mut - Visit every element exactly once, passing both the
Prong(so you knowthread_indexandtask_index) and a mutable reference to that element. - for_
each_ prong_ mut_ dynamic - Visit every element exactly once, passing both the
Prong(so you knowthread_indexandtask_index) and a mutable reference to that element. - for_n
- Distributes
nsimilar duration calls between threads by individual indices. - for_
n_ dynamic - Executes
nuneven tasks on all threads, greedily stealing work. - for_
slices - Distributes
nsimilar duration calls between threads in slices. - spawn
- Spawns a pool with the default allocator.