2 ms·
The problem of the CPU reordering things only exists on architectures like Alpha. However, there's still the problem of the compiler reordering things (which ex
by cwzwarich 4y ago
The problem of the CPU reordering things only exists on architectures like Alpha. However, there's still the problem of the compiler reordering things (which exists on every architecture), and memory_order_consume was intended to solve both. As you can see from the original rationale document from 2010, this RCU use-case was one of the main motivations:
https://www.open-std.org/jtc1/sc22/wg14/www/docs/n1525.htm https://www.open-std.org/jtc1/sc22/wg14/www/docs/n1525.htm