parcoll-1.2.0 has been yanked.
Parcoll
This repository provides optimized collections which can be used in concurrent runtimes.
It provides optimized ring-based SPSC (const bounded or unbounded), SPMC (const bounded or unbounded) and const bounded MPMC queues.
All queues are lock-free (or lock-free with the proper generics), generalized and can be either be cache-padded or not.
Usage
use ;
Benchmarks
Push + Pop (ns/op)
Push * 256 + steal + Pop * 256 (us/op)
Optimizations
All queues are optimized as much as possible (or we think so). It includes:
- cache-padding (not alignment);
- caching of atomics values where it makes sense;
- using as low CAS as possible.
Features
with-light-qsbr: Enables light-qsbr support.unbounded_slices_always_pow2: Ensures that unbounded slices are always power of two (it leads to more memory usage, but improves performance).always_steal: Always steals from the other queue when possible (by default, it may not steal if the source queue has less than four elements).untested_memory_ordering: Enables "untested" memory orderings. Honestly, they pass tests, but we didn't test them with very weak memory ordering (like the abstract machine). They seem correct and improve performance.
If you have any idea how to make it even better, please let us know (create either an issue or a pull request).