Thread.VolatileRead Thread.VolatileRead Thread.VolatileRead Thread.VolatileRead Method

Definition

Reads the value of a field. The value is the latest written by any processor in a computer, regardless of the number of processors or the state of processor cache.

Overloads

VolatileRead(SByte) VolatileRead(SByte) VolatileRead(SByte) VolatileRead(SByte)

Reads the value of a field. The value is the latest written by any processor in a computer, regardless of the number of processors or the state of processor cache.

VolatileRead(Single) VolatileRead(Single) VolatileRead(Single) VolatileRead(Single)

Reads the value of a field. The value is the latest written by any processor in a computer, regardless of the number of processors or the state of processor cache.

VolatileRead(UIntPtr) VolatileRead(UIntPtr) VolatileRead(UIntPtr) VolatileRead(UIntPtr)

Reads the value of a field. The value is the latest written by any processor in a computer, regardless of the number of processors or the state of processor cache.

VolatileRead(UInt32) VolatileRead(UInt32) VolatileRead(UInt32) VolatileRead(UInt32)

Reads the value of a field. The value is the latest written by any processor in a computer, regardless of the number of processors or the state of processor cache.

VolatileRead(UInt64) VolatileRead(UInt64) VolatileRead(UInt64) VolatileRead(UInt64)

Reads the value of a field. The value is the latest written by any processor in a computer, regardless of the number of processors or the state of processor cache.

VolatileRead(Object) VolatileRead(Object) VolatileRead(Object) VolatileRead(Object)

Reads the value of a field. The value is the latest written by any processor in a computer, regardless of the number of processors or the state of processor cache.

VolatileRead(UInt16) VolatileRead(UInt16) VolatileRead(UInt16) VolatileRead(UInt16)

Reads the value of a field. The value is the latest written by any processor in a computer, regardless of the number of processors or the state of processor cache.

VolatileRead(Int64) VolatileRead(Int64) VolatileRead(Int64) VolatileRead(Int64)

Reads the value of a field. The value is the latest written by any processor in a computer, regardless of the number of processors or the state of processor cache.

VolatileRead(IntPtr) VolatileRead(IntPtr) VolatileRead(IntPtr) VolatileRead(IntPtr)

Reads the value of a field. The value is the latest written by any processor in a computer, regardless of the number of processors or the state of processor cache.

VolatileRead(Int16) VolatileRead(Int16) VolatileRead(Int16) VolatileRead(Int16)

Reads the value of a field. The value is the latest written by any processor in a computer, regardless of the number of processors or the state of processor cache.

VolatileRead(Double) VolatileRead(Double) VolatileRead(Double) VolatileRead(Double)

Reads the value of a field. The value is the latest written by any processor in a computer, regardless of the number of processors or the state of processor cache.

VolatileRead(Byte) VolatileRead(Byte) VolatileRead(Byte) VolatileRead(Byte)

Reads the value of a field. The value is the latest written by any processor in a computer, regardless of the number of processors or the state of processor cache.

VolatileRead(Int32) VolatileRead(Int32) VolatileRead(Int32) VolatileRead(Int32)

Reads the value of a field. The value is the latest written by any processor in a computer, regardless of the number of processors or the state of processor cache.

VolatileRead(SByte) VolatileRead(SByte) VolatileRead(SByte) VolatileRead(SByte)

Important

This API is not CLS-compliant.

Reads the value of a field. The value is the latest written by any processor in a computer, regardless of the number of processors or the state of processor cache.

public:
 static System::SByte VolatileRead(System::SByte % address);
[System.CLSCompliant(false)]
public static sbyte VolatileRead (ref sbyte address);
static member VolatileRead :  -> sbyte
Public Shared Function VolatileRead (ByRef address As SByte) As SByte

Parameters

address
SByte SByte SByte SByte

The field to be read.

Returns

The latest value written to the field by any processor.

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, VolatileRead obtains the very latest value written to a memory location by any processor. 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.

VolatileRead(Single) VolatileRead(Single) VolatileRead(Single) VolatileRead(Single)

Reads the value of a field. The value is the latest written by any processor in a computer, regardless of the number of processors or the state of processor cache.

public:
 static float VolatileRead(float % address);
public static float VolatileRead (ref float address);
static member VolatileRead :  -> single
Public Shared Function VolatileRead (ByRef address As Single) As Single

Parameters

address
Single Single Single Single

The field to be read.

Returns

The latest value written to the field by any processor.

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, VolatileRead obtains the very latest value written to a memory location by any processor. 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.

VolatileRead(UIntPtr) VolatileRead(UIntPtr) VolatileRead(UIntPtr) VolatileRead(UIntPtr)

Important

This API is not CLS-compliant.

Reads the value of a field. The value is the latest written by any processor in a computer, regardless of the number of processors or the state of processor cache.

public:
 static UIntPtr VolatileRead(UIntPtr % address);
[System.CLSCompliant(false)]
public static UIntPtr VolatileRead (ref UIntPtr address);
static member VolatileRead :  -> unativeint
Public Shared Function VolatileRead (ByRef address As UIntPtr) As UIntPtr

Parameters

address
UIntPtr UIntPtr UIntPtr UIntPtr

The field to be read.

Returns

The latest value written to the field by any processor.

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, VolatileRead obtains the very latest value written to a memory location by any processor. 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.

VolatileRead(UInt32) VolatileRead(UInt32) VolatileRead(UInt32) VolatileRead(UInt32)

Important

This API is not CLS-compliant.

Reads the value of a field. The value is the latest written by any processor in a computer, regardless of the number of processors or the state of processor cache.

public:
 static System::UInt32 VolatileRead(System::UInt32 % address);
[System.CLSCompliant(false)]
public static uint VolatileRead (ref uint address);
static member VolatileRead :  -> uint32
Public Shared Function VolatileRead (ByRef address As UInteger) As UInteger

Parameters

address
UInt32 UInt32 UInt32 UInt32

The field to be read.

Returns

The latest value written to the field by any processor.

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, VolatileRead obtains the very latest value written to a memory location by any processor. 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.

VolatileRead(UInt64) VolatileRead(UInt64) VolatileRead(UInt64) VolatileRead(UInt64)

Important

This API is not CLS-compliant.

Reads the value of a field. The value is the latest written by any processor in a computer, regardless of the number of processors or the state of processor cache.

public:
 static System::UInt64 VolatileRead(System::UInt64 % address);
[System.CLSCompliant(false)]
public static ulong VolatileRead (ref ulong address);
static member VolatileRead :  -> uint64
Public Shared Function VolatileRead (ByRef address As ULong) As ULong

Parameters

address
UInt64 UInt64 UInt64 UInt64

The field to be read.

Returns

The latest value written to the field by any processor.

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, VolatileRead obtains the very latest value written to a memory location by any processor. 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.

VolatileRead(Object) VolatileRead(Object) VolatileRead(Object) VolatileRead(Object)

Reads the value of a field. The value is the latest written by any processor in a computer, regardless of the number of processors or the state of processor cache.

public:
 static System::Object ^ VolatileRead(System::Object ^ % address);
public static object VolatileRead (ref object address);
static member VolatileRead :  -> obj
Public Shared Function VolatileRead (ByRef address As Object) As Object

Parameters

address
Object Object Object Object

The field to be read.

Returns

The latest value written to the field by any processor.

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, VolatileRead obtains the very latest value written to a memory location by any processor. 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.

VolatileRead(UInt16) VolatileRead(UInt16) VolatileRead(UInt16) VolatileRead(UInt16)

Important

This API is not CLS-compliant.

Reads the value of a field. The value is the latest written by any processor in a computer, regardless of the number of processors or the state of processor cache.

public:
 static System::UInt16 VolatileRead(System::UInt16 % address);
[System.CLSCompliant(false)]
public static ushort VolatileRead (ref ushort address);
static member VolatileRead :  -> uint16
Public Shared Function VolatileRead (ByRef address As UShort) As UShort

Parameters

address
UInt16 UInt16 UInt16 UInt16

The field to be read.

Returns

The latest value written to the field by any processor.

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, VolatileRead obtains the very latest value written to a memory location by any processor. 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.

VolatileRead(Int64) VolatileRead(Int64) VolatileRead(Int64) VolatileRead(Int64)

Reads the value of a field. The value is the latest written by any processor in a computer, regardless of the number of processors or the state of processor cache.

public:
 static long VolatileRead(long % address);
public static long VolatileRead (ref long address);
static member VolatileRead :  -> int64
Public Shared Function VolatileRead (ByRef address As Long) As Long

Parameters

address
Int64 Int64 Int64 Int64

The field to be read.

Returns

The latest value written to the field by any processor.

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, VolatileRead obtains the very latest value written to a memory location by any processor. 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.

VolatileRead(IntPtr) VolatileRead(IntPtr) VolatileRead(IntPtr) VolatileRead(IntPtr)

Reads the value of a field. The value is the latest written by any processor in a computer, regardless of the number of processors or the state of processor cache.

public:
 static IntPtr VolatileRead(IntPtr % address);
public static IntPtr VolatileRead (ref IntPtr address);
static member VolatileRead :  -> nativeint
Public Shared Function VolatileRead (ByRef address As IntPtr) As IntPtr

Parameters

address
IntPtr IntPtr IntPtr IntPtr

The field to be read.

Returns

The latest value written to the field by any processor.

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, VolatileRead obtains the very latest value written to a memory location by any processor. 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.

VolatileRead(Int16) VolatileRead(Int16) VolatileRead(Int16) VolatileRead(Int16)

Reads the value of a field. The value is the latest written by any processor in a computer, regardless of the number of processors or the state of processor cache.

public:
 static short VolatileRead(short % address);
public static short VolatileRead (ref short address);
static member VolatileRead :  -> int16
Public Shared Function VolatileRead (ByRef address As Short) As Short

Parameters

address
Int16 Int16 Int16 Int16

The field to be read.

Returns

The latest value written to the field by any processor.

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, VolatileRead obtains the very latest value written to a memory location by any processor. 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.

VolatileRead(Double) VolatileRead(Double) VolatileRead(Double) VolatileRead(Double)

Reads the value of a field. The value is the latest written by any processor in a computer, regardless of the number of processors or the state of processor cache.

public:
 static double VolatileRead(double % address);
public static double VolatileRead (ref double address);
static member VolatileRead :  -> double
Public Shared Function VolatileRead (ByRef address As Double) As Double

Parameters

address
Double Double Double Double

The field to be read.

Returns

The latest value written to the field by any processor.

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, VolatileRead obtains the very latest value written to a memory location by any processor. 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.

VolatileRead(Byte) VolatileRead(Byte) VolatileRead(Byte) VolatileRead(Byte)

Reads the value of a field. The value is the latest written by any processor in a computer, regardless of the number of processors or the state of processor cache.

public:
 static System::Byte VolatileRead(System::Byte % address);
public static byte VolatileRead (ref byte address);
static member VolatileRead :  -> byte
Public Shared Function VolatileRead (ByRef address As Byte) As Byte

Parameters

address
Byte Byte Byte Byte

The field to be read.

Returns

The latest value written to the field by any processor.

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, VolatileRead obtains the very latest value written to a memory location by any processor. 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.

VolatileRead(Int32) VolatileRead(Int32) VolatileRead(Int32) VolatileRead(Int32)

Reads the value of a field. The value is the latest written by any processor in a computer, regardless of the number of processors or the state of processor cache.

public:
 static int VolatileRead(int % address);
public static int VolatileRead (ref int address);
static member VolatileRead :  -> int
Public Shared Function VolatileRead (ByRef address As Integer) As Integer

Parameters

address
Int32 Int32 Int32 Int32

The field to be read.

Returns

The latest value written to the field by any processor.

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, VolatileRead obtains the very latest value written to a memory location by any processor. 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