core::sync::atomic::Ordering - Rust
Description: API documentation for the Rust `Ordering` enum in crate `core`.
Keywords: rust, rustlang, rust-lang, Ordering

# Enum core::sync::atomic::Ordering 1.0.0[−][src]

    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

`Relaxed`

No ordering constraints, only atomic operations.

Corresponds to LLVM's `Monotonic` ordering.

`Release`

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.

`Acquire`

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.

`AcqRel`

Has the effects of both `Acquire` and `Release` together.

This ordering is only applicable for operations that combine both loads and stores.

For loads it uses `Acquire` ordering. For stores it uses the `Release` ordering.

`SeqCst`

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

## Trait Implementations

###

`impl Copy for Ordering`

[src]

###

`impl Clone for Ordering`

[src]

####

`fn clone(&self) -> Ordering`

[src]

Returns a copy of the value. Read more

####

`fn clone_from(&mut self, source: &Self)`

[src]

Performs copy-assignment from `source`. Read more

###

`impl Debug for Ordering`

[src]

####

`fn fmt(&self, f: &mut Formatter) -> Result`

[src]

Formats the value using the given formatter. Read more

## Auto Trait Implementations

###

`impl Send for Ordering`

###

`impl Sync for Ordering`

# Help

## Keyboard Shortcuts

`?`
  Show this help dialog
`S`
  Focus the search field
`↑`
  Move up in search results
`↓`
  Move down in search results
`↹`
  Switch tab
`⏎`
  Go to active search result
`+`
  Expand all sections
`-`
  Collapse all sections

## Search Tricks

Prefix searches with a type followed by a colon (e.g. `fn:`) to restrict the search to a given type.

Accepted types are: `fn`, `mod`, `struct`, `enum`, `trait`, `type`, `macro`, and `const`.

Search functions by type signature (e.g. `vec -> usize` or `* -> vec`)

Search multiple things at once by splitting your query with comma (e.g. `str,u8` or `String,struct:Vec,test`)