Memory order
Rules that define how memory operations from different threads can be observed in different orders without violating program correctness.
A processor can execute reads and writes in a different order than the source code specifies—register caching, pipeline reordering, and load-store buffers make this possible. Memory ordering defines which reorderings are allowed without breaking the program. Strong orderings (sequential consistency) forbid almost all reordering; weaker orderings (acquire-release, relaxed) allow more to speed up execution.
One thread can write a flag with relaxed semantics while another reads it with acquire semantics, creating a happens-before relation without a full barrier. Without proper memory ordering, scalable concurrent systems become impossible to build efficiently.