pub trait AtomicConsume {
type Val;
// Required method
fn load_consume(&self) -> Self::Val;
}Expand description
Trait which allows reading from primitive atomic types with “consume” ordering.
Required Associated Types§
Required Methods§
Sourcefn load_consume(&self) -> Self::Val
fn load_consume(&self) -> Self::Val
Loads 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).
Implementations on Foreign Types§
Source§impl AtomicConsume for AtomicBool
Available on non-crossbeam_no_atomic only.
impl AtomicConsume for AtomicBool
crossbeam_no_atomic only.type Val = bool
fn load_consume(&self) -> <AtomicBool as AtomicConsume>::Val
Source§impl AtomicConsume for AtomicI8
Available on non-crossbeam_no_atomic only.
impl AtomicConsume for AtomicI8
crossbeam_no_atomic only.type Val = i8
fn load_consume(&self) -> <AtomicI8 as AtomicConsume>::Val
Source§impl AtomicConsume for AtomicI16
Available on non-crossbeam_no_atomic only.
impl AtomicConsume for AtomicI16
crossbeam_no_atomic only.type Val = i16
fn load_consume(&self) -> <AtomicI16 as AtomicConsume>::Val
Source§impl AtomicConsume for AtomicI32
Available on non-crossbeam_no_atomic only.
impl AtomicConsume for AtomicI32
crossbeam_no_atomic only.type Val = i32
fn load_consume(&self) -> <AtomicI32 as AtomicConsume>::Val
Source§impl AtomicConsume for AtomicI64
Available on non-crossbeam_no_atomic only.
impl AtomicConsume for AtomicI64
crossbeam_no_atomic only.type Val = i64
fn load_consume(&self) -> <AtomicI64 as AtomicConsume>::Val
Source§impl AtomicConsume for AtomicIsize
Available on non-crossbeam_no_atomic only.
impl AtomicConsume for AtomicIsize
crossbeam_no_atomic only.type Val = isize
fn load_consume(&self) -> <AtomicIsize as AtomicConsume>::Val
Source§impl AtomicConsume for AtomicU8
Available on non-crossbeam_no_atomic only.
impl AtomicConsume for AtomicU8
crossbeam_no_atomic only.type Val = u8
fn load_consume(&self) -> <AtomicU8 as AtomicConsume>::Val
Source§impl AtomicConsume for AtomicU16
Available on non-crossbeam_no_atomic only.
impl AtomicConsume for AtomicU16
crossbeam_no_atomic only.type Val = u16
fn load_consume(&self) -> <AtomicU16 as AtomicConsume>::Val
Source§impl AtomicConsume for AtomicU32
Available on non-crossbeam_no_atomic only.
impl AtomicConsume for AtomicU32
crossbeam_no_atomic only.type Val = u32
fn load_consume(&self) -> <AtomicU32 as AtomicConsume>::Val
Source§impl AtomicConsume for AtomicU64
Available on non-crossbeam_no_atomic only.
impl AtomicConsume for AtomicU64
crossbeam_no_atomic only.type Val = u64
fn load_consume(&self) -> <AtomicU64 as AtomicConsume>::Val
Source§impl AtomicConsume for AtomicUsize
Available on non-crossbeam_no_atomic only.
impl AtomicConsume for AtomicUsize
crossbeam_no_atomic only.type Val = usize
fn load_consume(&self) -> <AtomicUsize as AtomicConsume>::Val
Source§impl<T> AtomicConsume for AtomicPtr<T>
Available on non-crossbeam_no_atomic only.
impl<T> AtomicConsume for AtomicPtr<T>
crossbeam_no_atomic only.