moirai-utils
Low-level utilities shared across the Moirai concurrency library, organized by domain:
cache—CacheAligned<T>(#[repr(align(64))]),align_to_cache_line,CACHE_LINE_SIZE.atomic—AtomicCounterfor lock-free counting.queue—LockFreeQueue.memory—prefetch_read/prefetch_write.simd—SimdScalar/SimdRealandhas_native_vector_path.
[]
= "0.5"
use ;
use align_of;
use AtomicUsize;
// Keep two hot indices off one cache line to avoid false sharing.
assert_eq!;
let _ring = Ring ;
let counter = new;
assert_eq!; // returns the previous value
assert_eq!;
Full documentation: https://docs.rs/moirai-utils
License
Licensed under either of Apache-2.0 or MIT at your option.