Memory reordering
The phenomenon where processors or compilers change the order of memory operations from the original program order to optimize performance, which can create data races if not synchronized.
Reordering occurs at three levels: compiler (source-level optimizations), CPU (out-of-order execution, store buffering, cache hierarchies), and architecture (weak memory models). A classic example: a CPU may buffer a write while reading from another memory region, causing the read to become visible before the write to other cores, despite program order.
This is why load barriers, store barriers and acquire-release exist — they force the processor to respect order. Without them, concurrent programming would be incomprehensible.