Module kernel::sync::atomic::ordering

source ·
Expand description

Memory orderings.

The semantics of these orderings follows the LKMM definitions and rules.

  • Acquire provides ordering between the load part of the annotated operation and all the following memory accesses, and if there is a store part, the store part has the Relaxed ordering.
  • Release provides ordering between all the preceding memory accesses and the store part of the annotated operation, and if there is a load part, the load part has the Relaxed ordering.
  • Full means “fully-ordered”, that is:
    • It provides ordering between all the preceding memory accesses and the annotated operation.
    • It provides ordering between the annotated operation and all the following memory accesses.
    • It provides ordering between all the preceding memory accesses and all the following memory accesses.
    • All the orderings are the same strength as a full memory barrier (i.e. smp_mb()).
  • Relaxed provides no ordering except the dependency orderings. Dependency orderings are described in “DEPENDENCY RELATIONS” in LKMM’s explanation.

Structs§

Traits§

  • The trait bound for operations that only support acquire or relaxed ordering.
  • The trait bound for annotating operations that support any ordering.
  • The trait bound for operations that only support release or relaxed ordering.