The new home for Visual Studio documentation is Visual Studio 2017 Documentation on docs.microsoft.com.
The latest version of this topic can be found at _ReadWriteBarrier.
Limits the compiler optimizations that can reorder memory accesses across the point of the call.
_ReadWriteBarrier compiler intrinsics and the
MemoryBarrier macro are all deprecated and should not be used. For inter-thread communication, use mechanisms such as atomic_thread_fence and std::atomic<T>, which are defined in the C++ Standard Library. For hardware access, use the /volatile:iso compiler option together with the volatile keyword.
Header file <intrin.h>
_ReadWriteBarrier intrinsic limits the compiler optimizations that can remove or reorder memory accesses across the point of the call.