What is the interaction of memory fences in different threads?
More particularly does a memory fence in a thread only prevents the reordering of instructions within the thread or there is there synchronising among the threads like one thread waits until the corresponding fence is reached in another thread? What happens is multiple threads have the same type of fence and multiple threads have paired fences? What type of fences needs to pair together among threads and how are they used? What are the effects if the code with memory fences is run in a single-threaded fashion?