Trait AtomicConsume
trait AtomicConsume
Trait which allows reading from primitive atomic types with "consume" ordering.
Associated Types
type ValType returned by
load_consume.
Required Methods
fn load_consume(self: &Self) -> <Self as >::ValLoads a value from the atomic using a "consume" memory ordering.
This is similar to the "acquire" ordering, except that an ordering is only guaranteed with operations that "depend on" the result of the load. However consume loads are usually much faster than acquire loads on architectures with a weak memory model since they don't require memory fence instructions.
The exact definition of "depend on" is a bit vague, but it works as you would expect in practice since a lot of software, especially the Linux kernel, rely on this behavior.
This is currently only implemented on ARM and AArch64, where a fence can be avoided. On other architectures this will fall back to a simple
load(Ordering::Acquire).
Implementors
impl AtomicConsume for core::sync::atomic::AtomicUsizeimpl AtomicConsume for core::sync::atomic::AtomicI8impl AtomicConsume for core::sync::atomic::AtomicU32impl AtomicConsume for core::sync::atomic::AtomicI64impl AtomicConsume for core::sync::atomic::AtomicIsizeimpl AtomicConsume for core::sync::atomic::AtomicU16impl AtomicConsume for core::sync::atomic::AtomicI32impl<T> AtomicConsume for core::sync::atomic::AtomicPtr<T>impl AtomicConsume for core::sync::atomic::AtomicBoolimpl AtomicConsume for core::sync::atomic::AtomicU8impl AtomicConsume for core::sync::atomic::AtomicI16impl AtomicConsume for core::sync::atomic::AtomicU64