The mfence
documentation says the following:
Performs a serializing operation on all load-from-memory and store-to-memory instructions that were issued prior the MFENCE instruction. This serializing operation guarantees that every load and store instruction that precedes the MFENCE instruction in program order becomes globally visible before any load or store instruction that follows the MFENCE instruction.
As far as I know, there is no fence instruction in x86 that prevents the reordering of non read and non write instructions.
Now if my program only have one thread, even if the instructions are reordered, it would still seem as if the instructions are executing in order.
But what if my program have multiple threads, and in one of the threads the non read and non write instructions are reordered, will the other threads notice this reordering (I assume the answer is No, or else there would be a fence instruction to stop the non read and non write instructions reordering, or maybe I'm missing something)?