So there is no memory_order_consume(C++11) in RUST?

I did not see it in "pub enum Ordering"

My understanding was that the consume ordering in C++ was never meaningfully implemented by any compiler (i.e. it’s optimized and codegen’d identically to acquire/release) due to specification issues that still have not been solved. See

So I always assumed (though I have no citation for this part) that it was intentionally omitted in Rust for now, and will likely be added if C++ ever gets a good enough fix for LLVM/Clang to implement.


This (consume) is in fact one reason why standard library Ordering is a non_exhaustive enum, so that we can add it later.

If you happen to have C++ code using consume that you need to port to Rust right now, it is always valid to replace consume with acquire, although it allows less optimization. In fact this is how LLVM/Clang implements it now: LLVM has no concept of consume, and Clang replaces consume with acquire.

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.