Thread.VolatileWrite Thread.VolatileWrite Thread.VolatileWrite Thread.VolatileWrite Method

Definition

Writes a value to a field immediately, so that the value is visible to all processors in the computer.

Overloads

VolatileWrite(UIntPtr, UIntPtr) VolatileWrite(UIntPtr, UIntPtr) VolatileWrite(UIntPtr, UIntPtr) VolatileWrite(UIntPtr, UIntPtr)

Writes a value to a field immediately, so that the value is visible to all processors in the computer.

VolatileWrite(UInt64, UInt64) VolatileWrite(UInt64, UInt64) VolatileWrite(UInt64, UInt64) VolatileWrite(UInt64, UInt64)

Writes a value to a field immediately, so that the value is visible to all processors in the computer.

VolatileWrite(UInt32, UInt32) VolatileWrite(UInt32, UInt32) VolatileWrite(UInt32, UInt32) VolatileWrite(UInt32, UInt32)

Writes a value to a field immediately, so that the value is visible to all processors in the computer.

VolatileWrite(UInt16, UInt16) VolatileWrite(UInt16, UInt16) VolatileWrite(UInt16, UInt16) VolatileWrite(UInt16, UInt16)

Writes a value to a field immediately, so that the value is visible to all processors in the computer.

VolatileWrite(Single, Single) VolatileWrite(Single, Single) VolatileWrite(Single, Single) VolatileWrite(Single, Single)

Writes a value to a field immediately, so that the value is visible to all processors in the computer.

VolatileWrite(SByte, SByte) VolatileWrite(SByte, SByte) VolatileWrite(SByte, SByte) VolatileWrite(SByte, SByte)

Writes a value to a field immediately, so that the value is visible to all processors in the computer.

VolatileWrite(Object, Object) VolatileWrite(Object, Object) VolatileWrite(Object, Object) VolatileWrite(Object, Object)

Writes a value to a field immediately, so that the value is visible to all processors in the computer.

VolatileWrite(IntPtr, IntPtr) VolatileWrite(IntPtr, IntPtr) VolatileWrite(IntPtr, IntPtr) VolatileWrite(IntPtr, IntPtr)

Writes a value to a field immediately, so that the value is visible to all processors in the computer.

VolatileWrite(Int16, Int16) VolatileWrite(Int16, Int16) VolatileWrite(Int16, Int16) VolatileWrite(Int16, Int16)

Writes a value to a field immediately, so that the value is visible to all processors in the computer.

VolatileWrite(Int32, Int32) VolatileWrite(Int32, Int32) VolatileWrite(Int32, Int32) VolatileWrite(Int32, Int32)

Writes a value to a field immediately, so that the value is visible to all processors in the computer.

VolatileWrite(Double, Double) VolatileWrite(Double, Double) VolatileWrite(Double, Double) VolatileWrite(Double, Double)

Writes a value to a field immediately, so that the value is visible to all processors in the computer.

VolatileWrite(Byte, Byte) VolatileWrite(Byte, Byte) VolatileWrite(Byte, Byte) VolatileWrite(Byte, Byte)

Writes a value to a field immediately, so that the value is visible to all processors in the computer.

VolatileWrite(Int64, Int64) VolatileWrite(Int64, Int64) VolatileWrite(Int64, Int64) VolatileWrite(Int64, Int64)

Writes a value to a field immediately, so that the value is visible to all processors in the computer.

VolatileWrite(UIntPtr, UIntPtr) VolatileWrite(UIntPtr, UIntPtr) VolatileWrite(UIntPtr, UIntPtr) VolatileWrite(UIntPtr, UIntPtr)

Important

This API is not CLS-compliant.

Writes a value to a field immediately, so that the value is visible to all processors in the computer.

public:
 static void VolatileWrite(UIntPtr % address, UIntPtr value);
[System.CLSCompliant(false)]
public static void VolatileWrite (ref UIntPtr address, UIntPtr value);
static member VolatileWrite :  * unativeint -> unit
Public Shared Sub VolatileWrite (ByRef address As UIntPtr, value As UIntPtr)

Parameters

address
UIntPtr UIntPtr UIntPtr UIntPtr

The field to which the value is to be written.

value
UIntPtr UIntPtr UIntPtr UIntPtr

The value to be written.

Remarks

VolatileRead and VolatileWrite are for special cases of synchronization. Under normal circumstances, the C# lock statement, the Visual Basic SyncLock statement, and the Monitor class provide easier alternatives.

On a multiprocessor system, VolatileWrite ensures that a value written to a memory location is immediately visible to all processors. This might require flushing processor caches.

Even on a uniprocessor system, VolatileRead and VolatileWrite ensure that a value is read or written to memory, and not cached (for example, in a processor register). Thus, you can use them to synchronize access to a field that can be updated by another thread, or by hardware.

Calling this method affects only a single memory access. To provide effective synchronization for a field, all access to the field must use VolatileRead or VolatileWrite.

Note

In C#, using the volatile modifier on a field guarantees that all access to that field uses VolatileRead or VolatileWrite.

VolatileWrite(UInt64, UInt64) VolatileWrite(UInt64, UInt64) VolatileWrite(UInt64, UInt64) VolatileWrite(UInt64, UInt64)

Important

This API is not CLS-compliant.

Writes a value to a field immediately, so that the value is visible to all processors in the computer.

public:
 static void VolatileWrite(System::UInt64 % address, System::UInt64 value);
[System.CLSCompliant(false)]
public static void VolatileWrite (ref ulong address, ulong value);
static member VolatileWrite :  * uint64 -> unit
Public Shared Sub VolatileWrite (ByRef address As ULong, value As ULong)

Parameters

address
UInt64 UInt64 UInt64 UInt64

The field to which the value is to be written.

value
UInt64 UInt64 UInt64 UInt64

The value to be written.

Remarks

VolatileRead and VolatileWrite are for special cases of synchronization. Under normal circumstances, the C# lock statement, the Visual Basic SyncLock statement, and the Monitor class provide easier alternatives.

On a multiprocessor system, VolatileWrite ensures that a value written to a memory location is immediately visible to all processors. This might require flushing processor caches.

Even on a uniprocessor system, VolatileRead and VolatileWrite ensure that a value is read or written to memory, and not cached (for example, in a processor register). Thus, you can use them to synchronize access to a field that can be updated by another thread, or by hardware.

Calling this method affects only a single memory access. To provide effective synchronization for a field, all access to the field must use VolatileRead or VolatileWrite.

Note

In C#, using the volatile modifier on a field guarantees that all access to that field uses VolatileRead or VolatileWrite.

VolatileWrite(UInt32, UInt32) VolatileWrite(UInt32, UInt32) VolatileWrite(UInt32, UInt32) VolatileWrite(UInt32, UInt32)

Important

This API is not CLS-compliant.

Writes a value to a field immediately, so that the value is visible to all processors in the computer.

public:
 static void VolatileWrite(System::UInt32 % address, System::UInt32 value);
[System.CLSCompliant(false)]
public static void VolatileWrite (ref uint address, uint value);
static member VolatileWrite :  * uint32 -> unit
Public Shared Sub VolatileWrite (ByRef address As UInteger, value As UInteger)

Parameters

address
UInt32 UInt32 UInt32 UInt32

The field to which the value is to be written.

value
UInt32 UInt32 UInt32 UInt32

The value to be written.

Remarks

VolatileRead and VolatileWrite are for special cases of synchronization. Under normal circumstances, the C# lock statement, the Visual Basic SyncLock statement, and the Monitor class provide easier alternatives.

On a multiprocessor system, VolatileWrite ensures that a value written to a memory location is immediately visible to all processors. This might require flushing processor caches.

Even on a uniprocessor system, VolatileRead and VolatileWrite ensure that a value is read or written to memory, and not cached (for example, in a processor register). Thus, you can use them to synchronize access to a field that can be updated by another thread, or by hardware.

Calling this method affects only a single memory access. To provide effective synchronization for a field, all access to the field must use VolatileRead or VolatileWrite.

Note

In C#, using the volatile modifier on a field guarantees that all access to that field uses VolatileRead or VolatileWrite.

VolatileWrite(UInt16, UInt16) VolatileWrite(UInt16, UInt16) VolatileWrite(UInt16, UInt16) VolatileWrite(UInt16, UInt16)

Important

This API is not CLS-compliant.

Writes a value to a field immediately, so that the value is visible to all processors in the computer.

public:
 static void VolatileWrite(System::UInt16 % address, System::UInt16 value);
[System.CLSCompliant(false)]
public static void VolatileWrite (ref ushort address, ushort value);
static member VolatileWrite :  * uint16 -> unit
Public Shared Sub VolatileWrite (ByRef address As UShort, value As UShort)

Parameters

address
UInt16 UInt16 UInt16 UInt16

The field to which the value is to be written.

value
UInt16 UInt16 UInt16 UInt16

The value to be written.

Remarks

VolatileRead and VolatileWrite are for special cases of synchronization. Under normal circumstances, the C# lock statement, the Visual Basic SyncLock statement, and the Monitor class provide easier alternatives.

On a multiprocessor system, VolatileWrite ensures that a value written to a memory location is immediately visible to all processors. This might require flushing processor caches.

Even on a uniprocessor system, VolatileRead and VolatileWrite ensure that a value is read or written to memory, and not cached (for example, in a processor register). Thus, you can use them to synchronize access to a field that can be updated by another thread, or by hardware.

Calling this method affects only a single memory access. To provide effective synchronization for a field, all access to the field must use VolatileRead or VolatileWrite.

Note

In C#, using the volatile modifier on a field guarantees that all access to that field uses VolatileRead or VolatileWrite.

VolatileWrite(Single, Single) VolatileWrite(Single, Single) VolatileWrite(Single, Single) VolatileWrite(Single, Single)

Writes a value to a field immediately, so that the value is visible to all processors in the computer.

public:
 static void VolatileWrite(float % address, float value);
public static void VolatileWrite (ref float address, float value);
static member VolatileWrite :  * single -> unit
Public Shared Sub VolatileWrite (ByRef address As Single, value As Single)

Parameters

address
Single Single Single Single

The field to which the value is to be written.

value
Single Single Single Single

The value to be written.

Remarks

VolatileRead and VolatileWrite are for special cases of synchronization. Under normal circumstances, the C# lock statement, the Visual Basic SyncLock statement, and the Monitor class provide easier alternatives.

On a multiprocessor system, VolatileWrite ensures that a value written to a memory location is immediately visible to all processors. This might require flushing processor caches.

Even on a uniprocessor system, VolatileRead and VolatileWrite ensure that a value is read or written to memory, and not cached (for example, in a processor register). Thus, you can use them to synchronize access to a field that can be updated by another thread, or by hardware.

Calling this method affects only a single memory access. To provide effective synchronization for a field, all access to the field must use VolatileRead or VolatileWrite.

Note

In C#, using the volatile modifier on a field guarantees that all access to that field uses VolatileRead or VolatileWrite.

VolatileWrite(SByte, SByte) VolatileWrite(SByte, SByte) VolatileWrite(SByte, SByte) VolatileWrite(SByte, SByte)

Important

This API is not CLS-compliant.

Writes a value to a field immediately, so that the value is visible to all processors in the computer.

public:
 static void VolatileWrite(System::SByte % address, System::SByte value);
[System.CLSCompliant(false)]
public static void VolatileWrite (ref sbyte address, sbyte value);
static member VolatileWrite :  * sbyte -> unit
Public Shared Sub VolatileWrite (ByRef address As SByte, value As SByte)

Parameters

address
SByte SByte SByte SByte

The field to which the value is to be written.

value
SByte SByte SByte SByte

The value to be written.

Remarks

VolatileRead and VolatileWrite are for special cases of synchronization. Under normal circumstances, the C# lock statement, the Visual Basic SyncLock statement, and the Monitor class provide easier alternatives.

On a multiprocessor system, VolatileWrite ensures that a value written to a memory location is immediately visible to all processors. This might require flushing processor caches.

Even on a uniprocessor system, VolatileRead and VolatileWrite ensure that a value is read or written to memory, and not cached (for example, in a processor register). Thus, you can use them to synchronize access to a field that can be updated by another thread, or by hardware.

Calling this method affects only a single memory access. To provide effective synchronization for a field, all access to the field must use VolatileRead or VolatileWrite.

Note

In C#, using the volatile modifier on a field guarantees that all access to that field uses VolatileRead or VolatileWrite.

VolatileWrite(Object, Object) VolatileWrite(Object, Object) VolatileWrite(Object, Object) VolatileWrite(Object, Object)

Writes a value to a field immediately, so that the value is visible to all processors in the computer.

public:
 static void VolatileWrite(System::Object ^ % address, System::Object ^ value);
public static void VolatileWrite (ref object address, object value);
static member VolatileWrite :  * obj -> unit
Public Shared Sub VolatileWrite (ByRef address As Object, value As Object)

Parameters

address
Object Object Object Object

The field to which the value is to be written.

value
Object Object Object Object

The value to be written.

Remarks

VolatileRead and VolatileWrite are for special cases of synchronization. Under normal circumstances, the C# lock statement, the Visual Basic SyncLock statement, and the Monitor class provide easier alternatives.

On a multiprocessor system, VolatileWrite ensures that a value written to a memory location is immediately visible to all processors. This might require flushing processor caches.

Even on a uniprocessor system, VolatileRead and VolatileWrite ensure that a value is read or written to memory, and not cached (for example, in a processor register). Thus, you can use them to synchronize access to a field that can be updated by another thread, or by hardware.

Calling this method affects only a single memory access. To provide effective synchronization for a field, all access to the field must use VolatileRead or VolatileWrite.

Note

In C#, using the volatile modifier on a field guarantees that all access to that field uses VolatileRead or VolatileWrite.

VolatileWrite(IntPtr, IntPtr) VolatileWrite(IntPtr, IntPtr) VolatileWrite(IntPtr, IntPtr) VolatileWrite(IntPtr, IntPtr)

Writes a value to a field immediately, so that the value is visible to all processors in the computer.

public:
 static void VolatileWrite(IntPtr % address, IntPtr value);
public static void VolatileWrite (ref IntPtr address, IntPtr value);
static member VolatileWrite :  * nativeint -> unit
Public Shared Sub VolatileWrite (ByRef address As IntPtr, value As IntPtr)

Parameters

address
IntPtr IntPtr IntPtr IntPtr

The field to which the value is to be written.

value
IntPtr IntPtr IntPtr IntPtr

The value to be written.

Remarks

VolatileRead and VolatileWrite are for special cases of synchronization. Under normal circumstances, the C# lock statement, the Visual Basic SyncLock statement, and the Monitor class provide easier alternatives.

On a multiprocessor system, VolatileWrite ensures that a value written to a memory location is immediately visible to all processors. This might require flushing processor caches.

Even on a uniprocessor system, VolatileRead and VolatileWrite ensure that a value is read or written to memory, and not cached (for example, in a processor register). Thus, you can use them to synchronize access to a field that can be updated by another thread, or by hardware.

Calling this method affects only a single memory access. To provide effective synchronization for a field, all access to the field must use VolatileRead or VolatileWrite.

Note

In C#, using the volatile modifier on a field guarantees that all access to that field uses VolatileRead or VolatileWrite.

VolatileWrite(Int16, Int16) VolatileWrite(Int16, Int16) VolatileWrite(Int16, Int16) VolatileWrite(Int16, Int16)

Writes a value to a field immediately, so that the value is visible to all processors in the computer.

public:
 static void VolatileWrite(short % address, short value);
public static void VolatileWrite (ref short address, short value);
static member VolatileWrite :  * int16 -> unit
Public Shared Sub VolatileWrite (ByRef address As Short, value As Short)

Parameters

address
Int16 Int16 Int16 Int16

The field to which the value is to be written.

value
Int16 Int16 Int16 Int16

The value to be written.

Remarks

VolatileRead and VolatileWrite are for special cases of synchronization. Under normal circumstances, the C# lock statement, the Visual Basic SyncLock statement, and the Monitor class provide easier alternatives.

On a multiprocessor system, VolatileWrite ensures that a value written to a memory location is immediately visible to all processors. This might require flushing processor caches.

Even on a uniprocessor system, VolatileRead and VolatileWrite ensure that a value is read or written to memory, and not cached (for example, in a processor register). Thus, you can use them to synchronize access to a field that can be updated by another thread, or by hardware.

Calling this method affects only a single memory access. To provide effective synchronization for a field, all access to the field must use VolatileRead or VolatileWrite.

Note

In C#, using the volatile modifier on a field guarantees that all access to that field uses VolatileRead or VolatileWrite.

VolatileWrite(Int32, Int32) VolatileWrite(Int32, Int32) VolatileWrite(Int32, Int32) VolatileWrite(Int32, Int32)

Writes a value to a field immediately, so that the value is visible to all processors in the computer.

public:
 static void VolatileWrite(int % address, int value);
public static void VolatileWrite (ref int address, int value);
static member VolatileWrite :  * int -> unit
Public Shared Sub VolatileWrite (ByRef address As Integer, value As Integer)

Parameters

address
Int32 Int32 Int32 Int32

The field to which the value is to be written.

value
Int32 Int32 Int32 Int32

The value to be written.

Remarks

VolatileRead and VolatileWrite are for special cases of synchronization. Under normal circumstances, the C# lock statement, the Visual Basic SyncLock statement, and the Monitor class provide easier alternatives.

On a multiprocessor system, VolatileWrite ensures that a value written to a memory location is immediately visible to all processors. This might require flushing processor caches.

Even on a uniprocessor system, VolatileRead and VolatileWrite ensure that a value is read or written to memory, and not cached (for example, in a processor register). Thus, you can use them to synchronize access to a field that can be updated by another thread, or by hardware.

Calling this method affects only a single memory access. To provide effective synchronization for a field, all access to the field must use VolatileRead or VolatileWrite.

Note

In C#, using the volatile modifier on a field guarantees that all access to that field uses VolatileRead or VolatileWrite.

VolatileWrite(Double, Double) VolatileWrite(Double, Double) VolatileWrite(Double, Double) VolatileWrite(Double, Double)

Writes a value to a field immediately, so that the value is visible to all processors in the computer.

public:
 static void VolatileWrite(double % address, double value);
public static void VolatileWrite (ref double address, double value);
static member VolatileWrite :  * double -> unit
Public Shared Sub VolatileWrite (ByRef address As Double, value As Double)

Parameters

address
Double Double Double Double

The field to which the value is to be written.

value
Double Double Double Double

The value to be written.

Remarks

VolatileRead and VolatileWrite are for special cases of synchronization. Under normal circumstances, the C# lock statement, the Visual Basic SyncLock statement, and the Monitor class provide easier alternatives.

On a multiprocessor system, VolatileWrite ensures that a value written to a memory location is immediately visible to all processors. This might require flushing processor caches.

Even on a uniprocessor system, VolatileRead and VolatileWrite ensure that a value is read or written to memory, and not cached (for example, in a processor register). Thus, you can use them to synchronize access to a field that can be updated by another thread, or by hardware.

Calling this method affects only a single memory access. To provide effective synchronization for a field, all access to the field must use VolatileRead or VolatileWrite.

Note

In C#, using the volatile modifier on a field guarantees that all access to that field uses VolatileRead or VolatileWrite.

VolatileWrite(Byte, Byte) VolatileWrite(Byte, Byte) VolatileWrite(Byte, Byte) VolatileWrite(Byte, Byte)

Writes a value to a field immediately, so that the value is visible to all processors in the computer.

public:
 static void VolatileWrite(System::Byte % address, System::Byte value);
public static void VolatileWrite (ref byte address, byte value);
static member VolatileWrite :  * byte -> unit
Public Shared Sub VolatileWrite (ByRef address As Byte, value As Byte)

Parameters

address
Byte Byte Byte Byte

The field to which the value is to be written.

value
Byte Byte Byte Byte

The value to be written.

Remarks

VolatileRead and VolatileWrite are for special cases of synchronization. Under normal circumstances, the C# lock statement, the Visual Basic SyncLock statement, and the Monitor class provide easier alternatives.

On a multiprocessor system, VolatileWrite ensures that a value written to a memory location is immediately visible to all processors. This might require flushing processor caches.

Even on a uniprocessor system, VolatileRead and VolatileWrite ensure that a value is read or written to memory, and not cached (for example, in a processor register). Thus, you can use them to synchronize access to a field that can be updated by another thread, or by hardware.

Calling this method affects only a single memory access. To provide effective synchronization for a field, all access to the field must use VolatileRead or VolatileWrite.

Note

In C#, using the volatile modifier on a field guarantees that all access to that field uses VolatileRead or VolatileWrite.

VolatileWrite(Int64, Int64) VolatileWrite(Int64, Int64) VolatileWrite(Int64, Int64) VolatileWrite(Int64, Int64)

Writes a value to a field immediately, so that the value is visible to all processors in the computer.

public:
 static void VolatileWrite(long % address, long value);
public static void VolatileWrite (ref long address, long value);
static member VolatileWrite :  * int64 -> unit
Public Shared Sub VolatileWrite (ByRef address As Long, value As Long)

Parameters

address
Int64 Int64 Int64 Int64

The field to which the value is to be written.

value
Int64 Int64 Int64 Int64

The value to be written.

Remarks

VolatileRead and VolatileWrite are for special cases of synchronization. Under normal circumstances, the C# lock statement, the Visual Basic SyncLock statement, and the Monitor class provide easier alternatives.

On a multiprocessor system, VolatileWrite ensures that a value written to a memory location is immediately visible to all processors. This might require flushing processor caches.

Even on a uniprocessor system, VolatileRead and VolatileWrite ensure that a value is read or written to memory, and not cached (for example, in a processor register). Thus, you can use them to synchronize access to a field that can be updated by another thread, or by hardware.

Calling this method affects only a single memory access. To provide effective synchronization for a field, all access to the field must use VolatileRead or VolatileWrite.

Note

In C#, using the volatile modifier on a field guarantees that all access to that field uses VolatileRead or VolatileWrite.

Applies to