Skip to main content
Journey Uncommon Logo
JourneyUncommon
hardC++relaxed memory semanticsSingle-choice MCQ

`std::memory_order_consume` was intended to be cheaper than acquire by relying on data dependencies. Why do mainstream compilers effectively treat it as `acquire`, and what is the underlying concept they failed to implement well?

std::atomic<Node*> head; Node* p = head.load(std::memory_order_consume); int v = p->value; // dependency-ordered-before via p