Module atomic_utilities::fence_rmw
[−]
[src]
This mod provides orderings to use with RMW operations that optimally handle the case when all loads and stores after an RMW operation must be ordered after the operation.
Example:
use std::sync::atomic::{AtomicUsize, fence, Ordering}; use atomic_utilities::fence_rmw::{RMWOrder, fence_rmw}; let atomic_refcnt = AtomicUsize::new(0); atomic_refcnt.fetch_add(1, RMWOrder); // ... do work here // This will be ordered after the store of the fetch_add // and will use minimal fences for various hardware platforms atomic_refcnt.fetch_sub(1, Ordering::Release);
Constants
RMWOrder |
The ordering to be used for RMW operations in this fencing scheme |
Functions
fence_rmw |
The fence to be used after the RMW |