|
|
|
|
|
by Diggsey
2352 days ago
|
|
One thing omitted from this article is that it's not only the physical hardware that may (effectively) re-order operations. The compiler may also perform these re-orderings. The compiler's re-orderings will always be valid according to the abstract memory model rather than the hardware's, so even on x86 you must use the correct memory orderings, or risk subtle bugs due to compiler optimisations. |
|
[1] https://gcc.gnu.org/onlinedocs/gcc/Volatiles.html