IMO, the various blogs and tutorials out there that help to make sense of the C++11 memory model make better tutorials than the Linux kernel's own shenanigans.
The C++11/C11 memory model added memory_order_consume specifically to support the Alpha.
> The C++11/C11 memory model added memory_order_consume specifically to support the Alpha.
yes and no. Alpha is relevant because it is the only architecture where consume requires an explicit barrier, but then again, I think the revised C++11 memory model might not even be fully implementable on Alpha;
Consume primarily exist because acquire is very expensive to implement in traditional RISCs like POWER and 32 bit ARM, while consume can be implemented with a data or control dependency. Aarch64 has efficient acquire/release barriers, so it is less of an issue.
C++11/C11 are not implementable on Alpha CPUs that don't have BWX extensions, BTW.
This is because it requires individual bytes to be accessible in atomic way between multiple threads, which without BWX is not possible on Alpha, which started out with minimum 32bit read/writes.
yes, but even beyond that, I think think there were changes and/or clarifications to the semantics of releaxed atomics that made the straightforward no-barriers-at-all implementation on alpha non-conformant strictly speaking. But I might be misremembering.
The C++11/C11 memory model added memory_order_consume specifically to support the Alpha.
https://preshing.com/20140709/the-purpose-of-memory_order_co...