I have been studying the memory order semantics in C++ 11 and having some difficulty in understanding how memory_order_acquire works in a CPU level.
According to the cppreference;
A load operation with this memory order performs the acquire operation on the affected memory location: no reads or writes in the current thread can be reordered before this load. All writes in other threads that release the same atomic variable are visible in the current thread (see Release-Acquire ordering below)
The part I really can't understand is;
no reads or writes in the current thread can be reordered before this load.
What happens if the CPU has already reordered commands before even reaching 'memory_order_acquire' part? Does the CPU reverts all the work has done? How does this can be guaranteed?
Thank you.