memoryorderconsume
Memory_order_consume is a memory ordering option defined for atomic operations in the C and C++ memory model. It is the weakest form of synchronization intended to use data dependencies rather than explicit cross-thread ordering to enforce visibility and ordering guarantees. When used on an atomic load, memory_order_consume ensures that subsequent operations that directly depend on the loaded value (for example, dereferencing a pointer obtained from the load to access further data) respect a happens-before relationship with that load.
In practice, memory_order_consume relies on the ability to propagate a data dependency through the program. If
Developers commonly prefer memory_order_acquire for consumer-side synchronization and memory_order_release for producer-side synchronization, paired to establish clear
See also memory_order, memory_order_acquire, memory_order_release, memory_order_relaxed, memory_order_seq_cst.