just::thread Complete C++ Standard Thread Library by Just Software Solutions

Documentation Home >> Headers >> <atomic> Header >> std::memory_order enumeration

The std::memory_order enumeration is used to specify the ordering constraints of atomic operations.

typedef enum memory_order
} memory_order;

Operations tagged with the various memory order values behave as follows:


The operation does not provide any additional ordering constraints.


The operation is a release operation on the specified memory location. This therefore synchronizes-with an acquire operation on the same memory location that reads the stored value.


The operation is an acquire operation on the specified memory location. If the stored value was written by a release operation, that store synchronizes-with this operation.


The operation must be a read-modify-write operation, and behaves as both std::memory_order_acquire and std::memory_order_release on the specified location.


The operation forms part of the single global total order of sequentially consistent operations. Additionally, if it is a store then it behaves like a std::memory_order_release operation, if it is a load it behaves like a std::memory_order_acquire operation, and if it is a read-modify-write operation then it behaves as both std::memory_order_acquire and std::memory_order_release. This is the default for all operations.


The operation is a consume operation on the specified memory location.


#include <atomic>

See Also