Atomic<T> wrapper type
Atomic types provide primitive shared-memory communication between threads, and are the building blocks of other concurrent types.
This library defines a generic atomic wrapper type
Atomic<T> for all
T: NoUninit types.
Atomic types present operations that, when used correctly, synchronize
updates between threads.
NoUninit bound is from the bytemuck crate, and indicates that a
type has no internal padding bytes. You will need to derive or implement
this trait for all types used with
Each method takes an
Ordering which represents the strength of
the memory barrier for that operation. These orderings are the
same as LLVM atomic orderings.
Atomic variables are safe to share between threads (they implement
but they do not themselves provide the mechanism for sharing. The most
common way to share an atomic variable is to put it into an
atomically-reference-counted shared pointer).
Most atomic types may be stored in static variables, initialized using
const fn constructors. Atomic statics are often used for lazy global
- A generic atomic wrapper type which allows an object to be safely shared between threads.
- Atomic memory orderings
- An atomic fence.