|Important||This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here. ArchiveDisclaimer|
_ReadWriteBarrier forces all previous memory accesses to complete before subsequent memory access is started.
_WriteBarrier forces all previous memory write operations to complete before any subsequent write operation is started.
void __cdecl _ReadWriteBarrier(void); void __cdecl _WriteBarrier(void);
_WriteBarrier is usually used for writing device drivers to make sure that a set of commands has been sent to the device before further commands are issued. The compiler does not reschedule memory writes across an invocation of _WriteBarrier, even on hardware platforms without explicit synchronization instructions.
_ReadWriteBarrier is usually used for writing device drivers to make sure that commands have been sent to the device before status is read.
The compiler does not reschedule memory reads and writes across an invocation of _ReadWriteBarrier, even on hardware platforms without explicit synchronization instructions.