This documentation is archived and is not being maintained.

Thread.MemoryBarrier Method

Note: This namespace, class, or member is supported only in version 1.1 of the .NET Framework.

Synchronizes memory. In effect, flushes the contents of cache memory to main memory, for the processor executing the current thread.

[Visual Basic]
Public Shared Sub MemoryBarrier()
public static void MemoryBarrier();
public: static void MemoryBarrier();
public static function MemoryBarrier();


MemoryBarrier is required only on multiprocessor systems with weak memory ordering (for example, a system employing multiple Intel Itanium processors).

For most purposes, the C# lock statement, the Visual Basic SyncLock statement, or the Monitor class provide easier ways to synchronize data.


Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

See Also

Thread Class | Thread Members | System.Threading Namespace