W3cubDocs

/Rust

Enum std::sync::atomic::Ordering

pub enum Ordering {
    Relaxed,
    Release,
    Acquire,
    AcqRel,
    SeqCst,
    // some variants omitted
}

Atomic memory orderings

Memory orderings limit the ways that both the compiler and CPU may reorder instructions around atomic operations. At its most restrictive, "sequentially consistent" atomics allow neither reads nor writes to be moved either before or after the atomic operation; on the other end "relaxed" atomics allow all reorderings.

Rust's memory orderings are the same as LLVM's.

For more information see the nomicon.

Variants

No ordering constraints, only atomic operations. Corresponds to LLVM's Monotonic ordering.

When coupled with a store, all previous writes become visible to the other threads that perform a load with Acquire ordering on the same value.

When coupled with a load, all subsequent loads will see data written before a store with Release ordering on the same value in other threads.

When coupled with a load, uses Acquire ordering, and with a store Release ordering.

Like AcqRel with the additional guarantee that all threads see all sequentially consistent operations in the same order.

Trait Implementations

impl Clone for Ordering [src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Debug for Ordering [src]

Formats the value using the given formatter.

impl Copy for Ordering [src]

© 2010 The Rust Project Developers
Licensed under the Apache License, Version 2.0 or the MIT license, at your option.
https://doc.rust-lang.org/std/sync/atomic/enum.Ordering.html