Thread.VolatileRead Method  
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Reads the value of a field. On systems that require it, inserts a memory barrier that prevents the processor from reordering memory operations as follows: If a read or write appears after this method in the code, the processor cannot move it before this method.
Overloads
| VolatileRead(SByte) | 
		Obsolete.
	 Reads the value of a field. On systems that require it, inserts a memory barrier that prevents the processor from reordering memory operations as follows: If a read or write appears after this method in the code, the processor cannot move it before this method. | 
| VolatileRead(Single) | 
		Obsolete.
	 Reads the value of a field. On systems that require it, inserts a memory barrier that prevents the processor from reordering memory operations as follows: If a read or write appears after this method in the code, the processor cannot move it before this method. | 
| VolatileRead(UInt64) | 
		Obsolete.
	 Reads the value of a field. On systems that require it, inserts a memory barrier that prevents the processor from reordering memory operations as follows: If a read or write appears after this method in the code, the processor cannot move it before this method. | 
| VolatileRead(UInt32) | 
		Obsolete.
	 Reads the value of a field. On systems that require it, inserts a memory barrier that prevents the processor from reordering memory operations as follows: If a read or write appears after this method in the code, the processor cannot move it before this method. | 
| VolatileRead(Object) | 
		Obsolete.
	 Reads the value of a field. On systems that require it, inserts a memory barrier that prevents the processor from reordering memory operations as follows: If a read or write appears after this method in the code, the processor cannot move it before this method. | 
| VolatileRead(UIntPtr) | 
		Obsolete.
	 Reads the value of a field. On systems that require it, inserts a memory barrier that prevents the processor from reordering memory operations as follows: If a read or write appears after this method in the code, the processor cannot move it before this method. | 
| VolatileRead(UInt16) | 
		Obsolete.
	 Reads the value of a field. On systems that require it, inserts a memory barrier that prevents the processor from reordering memory operations as follows: If a read or write appears after this method in the code, the processor cannot move it before this method. | 
| VolatileRead(Int64) | 
		Obsolete.
	 Reads the value of a field. On systems that require it, inserts a memory barrier that prevents the processor from reordering memory operations as follows: If a read or write appears after this method in the code, the processor cannot move it before this method. | 
| VolatileRead(IntPtr) | 
		Obsolete.
	 Reads the value of a field. On systems that require it, inserts a memory barrier that prevents the processor from reordering memory operations as follows: If a read or write appears after this method in the code, the processor cannot move it before this method. | 
| VolatileRead(Int16) | 
		Obsolete.
	 Reads the value of a field. On systems that require it, inserts a memory barrier that prevents the processor from reordering memory operations as follows: If a read or write appears after this method in the code, the processor cannot move it before this method. | 
| VolatileRead(Double) | 
		Obsolete.
	 Reads the value of a field. On systems that require it, inserts a memory barrier that prevents the processor from reordering memory operations as follows: If a read or write appears after this method in the code, the processor cannot move it before this method. | 
| VolatileRead(Byte) | 
		Obsolete.
	 Reads the value of a field. On systems that require it, inserts a memory barrier that prevents the processor from reordering memory operations as follows: If a read or write appears after this method in the code, the processor cannot move it before this method. | 
| VolatileRead(Int32) | 
		Obsolete.
	 Reads the value of a field. On systems that require it, inserts a memory barrier that prevents the processor from reordering memory operations as follows: If a read or write appears after this method in the code, the processor cannot move it before this method. | 
VolatileRead(SByte)
- Source:
- Thread.cs
- Source:
- Thread.cs
- Source:
- Thread.cs
- Source:
- Thread.cs
Caution
Thread.VolatileRead and Thread.VolatileWrite are obsolete. Use Volatile.Read or Volatile.Write respectively instead.
Important
This API is not CLS-compliant.
Reads the value of a field. On systems that require it, inserts a memory barrier that prevents the processor from reordering memory operations as follows: If a read or write appears after this method in the code, the processor cannot move it before this method.
public:
 static System::SByte VolatileRead(System::SByte % address);[System.CLSCompliant(false)]
[System.Obsolete("Thread.VolatileRead and Thread.VolatileWrite are obsolete. Use Volatile.Read or Volatile.Write respectively instead.", DiagnosticId="SYSLIB0054", UrlFormat="https://aka.ms/dotnet-warnings/{0}")]
public static sbyte VolatileRead(ref sbyte address);[System.CLSCompliant(false)]
public static sbyte VolatileRead(ref sbyte address);[<System.CLSCompliant(false)>]
[<System.Obsolete("Thread.VolatileRead and Thread.VolatileWrite are obsolete. Use Volatile.Read or Volatile.Write respectively instead.", DiagnosticId="SYSLIB0054", UrlFormat="https://aka.ms/dotnet-warnings/{0}")>]
static member VolatileRead : sbyte -> sbyte[<System.CLSCompliant(false)>]
static member VolatileRead : sbyte -> sbytePublic Shared Function VolatileRead (ByRef address As SByte) As SByteParameters
- address
- SByte
The field to be read.
Returns
The value that was read.
- Attributes
Remarks
Thread.VolatileRead and Thread.VolatileWrite are legacy APIs and have been replaced by Volatile.Read and Volatile.Write. See the Volatile class for more information.
Applies to
VolatileRead(Single)
- Source:
- Thread.cs
- Source:
- Thread.cs
- Source:
- Thread.cs
- Source:
- Thread.cs
Caution
Thread.VolatileRead and Thread.VolatileWrite are obsolete. Use Volatile.Read or Volatile.Write respectively instead.
Reads the value of a field. On systems that require it, inserts a memory barrier that prevents the processor from reordering memory operations as follows: If a read or write appears after this method in the code, the processor cannot move it before this method.
public:
 static float VolatileRead(float % address);[System.Obsolete("Thread.VolatileRead and Thread.VolatileWrite are obsolete. Use Volatile.Read or Volatile.Write respectively instead.", DiagnosticId="SYSLIB0054", UrlFormat="https://aka.ms/dotnet-warnings/{0}")]
public static float VolatileRead(ref float address);public static float VolatileRead(ref float address);[<System.Obsolete("Thread.VolatileRead and Thread.VolatileWrite are obsolete. Use Volatile.Read or Volatile.Write respectively instead.", DiagnosticId="SYSLIB0054", UrlFormat="https://aka.ms/dotnet-warnings/{0}")>]
static member VolatileRead : single -> singlestatic member VolatileRead : single -> singlePublic Shared Function VolatileRead (ByRef address As Single) As SingleParameters
- address
- Single
The field to be read.
Returns
The value that was read.
- Attributes
Remarks
Thread.VolatileRead and Thread.VolatileWrite are legacy APIs and have been replaced by Volatile.Read and Volatile.Write. See the Volatile class for more information.
Applies to
VolatileRead(UInt64)
- Source:
- Thread.cs
- Source:
- Thread.cs
- Source:
- Thread.cs
- Source:
- Thread.cs
Caution
Thread.VolatileRead and Thread.VolatileWrite are obsolete. Use Volatile.Read or Volatile.Write respectively instead.
Important
This API is not CLS-compliant.
Reads the value of a field. On systems that require it, inserts a memory barrier that prevents the processor from reordering memory operations as follows: If a read or write appears after this method in the code, the processor cannot move it before this method.
public:
 static System::UInt64 VolatileRead(System::UInt64 % address);[System.CLSCompliant(false)]
[System.Obsolete("Thread.VolatileRead and Thread.VolatileWrite are obsolete. Use Volatile.Read or Volatile.Write respectively instead.", DiagnosticId="SYSLIB0054", UrlFormat="https://aka.ms/dotnet-warnings/{0}")]
public static ulong VolatileRead(ref ulong address);[System.CLSCompliant(false)]
public static ulong VolatileRead(ref ulong address);[<System.CLSCompliant(false)>]
[<System.Obsolete("Thread.VolatileRead and Thread.VolatileWrite are obsolete. Use Volatile.Read or Volatile.Write respectively instead.", DiagnosticId="SYSLIB0054", UrlFormat="https://aka.ms/dotnet-warnings/{0}")>]
static member VolatileRead : uint64 -> uint64[<System.CLSCompliant(false)>]
static member VolatileRead : uint64 -> uint64Public Shared Function VolatileRead (ByRef address As ULong) As ULongParameters
- address
- UInt64
The field to be read.
Returns
The value that was read.
- Attributes
Remarks
Thread.VolatileRead and Thread.VolatileWrite are legacy APIs and have been replaced by Volatile.Read and Volatile.Write. See the Volatile class for more information.
Applies to
VolatileRead(UInt32)
- Source:
- Thread.cs
- Source:
- Thread.cs
- Source:
- Thread.cs
- Source:
- Thread.cs
Caution
Thread.VolatileRead and Thread.VolatileWrite are obsolete. Use Volatile.Read or Volatile.Write respectively instead.
Important
This API is not CLS-compliant.
Reads the value of a field. On systems that require it, inserts a memory barrier that prevents the processor from reordering memory operations as follows: If a read or write appears after this method in the code, the processor cannot move it before this method.
public:
 static System::UInt32 VolatileRead(System::UInt32 % address);[System.CLSCompliant(false)]
[System.Obsolete("Thread.VolatileRead and Thread.VolatileWrite are obsolete. Use Volatile.Read or Volatile.Write respectively instead.", DiagnosticId="SYSLIB0054", UrlFormat="https://aka.ms/dotnet-warnings/{0}")]
public static uint VolatileRead(ref uint address);[System.CLSCompliant(false)]
public static uint VolatileRead(ref uint address);[<System.CLSCompliant(false)>]
[<System.Obsolete("Thread.VolatileRead and Thread.VolatileWrite are obsolete. Use Volatile.Read or Volatile.Write respectively instead.", DiagnosticId="SYSLIB0054", UrlFormat="https://aka.ms/dotnet-warnings/{0}")>]
static member VolatileRead : uint32 -> uint32[<System.CLSCompliant(false)>]
static member VolatileRead : uint32 -> uint32Public Shared Function VolatileRead (ByRef address As UInteger) As UIntegerParameters
- address
- UInt32
The field to be read.
Returns
The value that was read.
- Attributes
Remarks
Thread.VolatileRead and Thread.VolatileWrite are legacy APIs and have been replaced by Volatile.Read and Volatile.Write. See the Volatile class for more information.
Applies to
VolatileRead(Object)
- Source:
- Thread.cs
- Source:
- Thread.cs
- Source:
- Thread.cs
- Source:
- Thread.cs
Caution
Thread.VolatileRead and Thread.VolatileWrite are obsolete. Use Volatile.Read or Volatile.Write respectively instead.
Reads the value of a field. On systems that require it, inserts a memory barrier that prevents the processor from reordering memory operations as follows: If a read or write appears after this method in the code, the processor cannot move it before this method.
public:
 static System::Object ^ VolatileRead(System::Object ^ % address);[System.Obsolete("Thread.VolatileRead and Thread.VolatileWrite are obsolete. Use Volatile.Read or Volatile.Write respectively instead.", DiagnosticId="SYSLIB0054", UrlFormat="https://aka.ms/dotnet-warnings/{0}")]
public static object? VolatileRead(ref object? address);public static object? VolatileRead(ref object? address);public static object VolatileRead(ref object address);[<System.Obsolete("Thread.VolatileRead and Thread.VolatileWrite are obsolete. Use Volatile.Read or Volatile.Write respectively instead.", DiagnosticId="SYSLIB0054", UrlFormat="https://aka.ms/dotnet-warnings/{0}")>]
static member VolatileRead : obj -> objstatic member VolatileRead : obj -> objPublic Shared Function VolatileRead (ByRef address As Object) As ObjectParameters
- address
- Object
The field to be read.
Returns
The value that was read.
- Attributes
Remarks
Thread.VolatileRead and Thread.VolatileWrite are legacy APIs and have been replaced by Volatile.Read and Volatile.Write. See the Volatile class for more information.
Applies to
VolatileRead(UIntPtr)
- Source:
- Thread.cs
- Source:
- Thread.cs
- Source:
- Thread.cs
- Source:
- Thread.cs
Caution
Thread.VolatileRead and Thread.VolatileWrite are obsolete. Use Volatile.Read or Volatile.Write respectively instead.
Important
This API is not CLS-compliant.
Reads the value of a field. On systems that require it, inserts a memory barrier that prevents the processor from reordering memory operations as follows: If a read or write appears after this method in the code, the processor cannot move it before this method.
public:
 static UIntPtr VolatileRead(UIntPtr % address);[System.CLSCompliant(false)]
[System.Obsolete("Thread.VolatileRead and Thread.VolatileWrite are obsolete. Use Volatile.Read or Volatile.Write respectively instead.", DiagnosticId="SYSLIB0054", UrlFormat="https://aka.ms/dotnet-warnings/{0}")]
public static UIntPtr VolatileRead(ref UIntPtr address);[System.CLSCompliant(false)]
public static UIntPtr VolatileRead(ref UIntPtr address);[<System.CLSCompliant(false)>]
[<System.Obsolete("Thread.VolatileRead and Thread.VolatileWrite are obsolete. Use Volatile.Read or Volatile.Write respectively instead.", DiagnosticId="SYSLIB0054", UrlFormat="https://aka.ms/dotnet-warnings/{0}")>]
static member VolatileRead : unativeint -> unativeint[<System.CLSCompliant(false)>]
static member VolatileRead : unativeint -> unativeintPublic Shared Function VolatileRead (ByRef address As UIntPtr) As UIntPtrParameters
- address
- 
				
				UIntPtr
unativeint 
The field to be read.
Returns
unativeint
The value that was read.
- Attributes
Remarks
Thread.VolatileRead and Thread.VolatileWrite are legacy APIs and have been replaced by Volatile.Read and Volatile.Write. See the Volatile class for more information.
Applies to
VolatileRead(UInt16)
- Source:
- Thread.cs
- Source:
- Thread.cs
- Source:
- Thread.cs
- Source:
- Thread.cs
Caution
Thread.VolatileRead and Thread.VolatileWrite are obsolete. Use Volatile.Read or Volatile.Write respectively instead.
Important
This API is not CLS-compliant.
Reads the value of a field. On systems that require it, inserts a memory barrier that prevents the processor from reordering memory operations as follows: If a read or write appears after this method in the code, the processor cannot move it before this method.
public:
 static System::UInt16 VolatileRead(System::UInt16 % address);[System.CLSCompliant(false)]
[System.Obsolete("Thread.VolatileRead and Thread.VolatileWrite are obsolete. Use Volatile.Read or Volatile.Write respectively instead.", DiagnosticId="SYSLIB0054", UrlFormat="https://aka.ms/dotnet-warnings/{0}")]
public static ushort VolatileRead(ref ushort address);[System.CLSCompliant(false)]
public static ushort VolatileRead(ref ushort address);[<System.CLSCompliant(false)>]
[<System.Obsolete("Thread.VolatileRead and Thread.VolatileWrite are obsolete. Use Volatile.Read or Volatile.Write respectively instead.", DiagnosticId="SYSLIB0054", UrlFormat="https://aka.ms/dotnet-warnings/{0}")>]
static member VolatileRead : uint16 -> uint16[<System.CLSCompliant(false)>]
static member VolatileRead : uint16 -> uint16Public Shared Function VolatileRead (ByRef address As UShort) As UShortParameters
- address
- UInt16
The field to be read.
Returns
The value that was read.
- Attributes
Remarks
Thread.VolatileRead and Thread.VolatileWrite are legacy APIs and have been replaced by Volatile.Read and Volatile.Write. See the Volatile class for more information.
Applies to
VolatileRead(Int64)
- Source:
- Thread.cs
- Source:
- Thread.cs
- Source:
- Thread.cs
- Source:
- Thread.cs
Caution
Thread.VolatileRead and Thread.VolatileWrite are obsolete. Use Volatile.Read or Volatile.Write respectively instead.
Reads the value of a field. On systems that require it, inserts a memory barrier that prevents the processor from reordering memory operations as follows: If a read or write appears after this method in the code, the processor cannot move it before this method.
public:
 static long VolatileRead(long % address);[System.Obsolete("Thread.VolatileRead and Thread.VolatileWrite are obsolete. Use Volatile.Read or Volatile.Write respectively instead.", DiagnosticId="SYSLIB0054", UrlFormat="https://aka.ms/dotnet-warnings/{0}")]
public static long VolatileRead(ref long address);public static long VolatileRead(ref long address);[<System.Obsolete("Thread.VolatileRead and Thread.VolatileWrite are obsolete. Use Volatile.Read or Volatile.Write respectively instead.", DiagnosticId="SYSLIB0054", UrlFormat="https://aka.ms/dotnet-warnings/{0}")>]
static member VolatileRead : int64 -> int64static member VolatileRead : int64 -> int64Public Shared Function VolatileRead (ByRef address As Long) As LongParameters
- address
- Int64
The field to be read.
Returns
The value that was read.
- Attributes
Remarks
Thread.VolatileRead and Thread.VolatileWrite are legacy APIs and have been replaced by Volatile.Read and Volatile.Write. See the Volatile class for more information.
Applies to
VolatileRead(IntPtr)
- Source:
- Thread.cs
- Source:
- Thread.cs
- Source:
- Thread.cs
- Source:
- Thread.cs
Caution
Thread.VolatileRead and Thread.VolatileWrite are obsolete. Use Volatile.Read or Volatile.Write respectively instead.
Reads the value of a field. On systems that require it, inserts a memory barrier that prevents the processor from reordering memory operations as follows: If a read or write appears after this method in the code, the processor cannot move it before this method.
public:
 static IntPtr VolatileRead(IntPtr % address);[System.Obsolete("Thread.VolatileRead and Thread.VolatileWrite are obsolete. Use Volatile.Read or Volatile.Write respectively instead.", DiagnosticId="SYSLIB0054", UrlFormat="https://aka.ms/dotnet-warnings/{0}")]
public static IntPtr VolatileRead(ref IntPtr address);public static IntPtr VolatileRead(ref IntPtr address);[<System.Obsolete("Thread.VolatileRead and Thread.VolatileWrite are obsolete. Use Volatile.Read or Volatile.Write respectively instead.", DiagnosticId="SYSLIB0054", UrlFormat="https://aka.ms/dotnet-warnings/{0}")>]
static member VolatileRead : nativeint -> nativeintstatic member VolatileRead : nativeint -> nativeintPublic Shared Function VolatileRead (ByRef address As IntPtr) As IntPtrParameters
- address
- 
				
				IntPtr
nativeint 
The field to be read.
Returns
nativeint
The value that was read.
- Attributes
Remarks
Thread.VolatileRead and Thread.VolatileWrite are legacy APIs and have been replaced by Volatile.Read and Volatile.Write. See the Volatile class for more information.
Applies to
VolatileRead(Int16)
- Source:
- Thread.cs
- Source:
- Thread.cs
- Source:
- Thread.cs
- Source:
- Thread.cs
Caution
Thread.VolatileRead and Thread.VolatileWrite are obsolete. Use Volatile.Read or Volatile.Write respectively instead.
Reads the value of a field. On systems that require it, inserts a memory barrier that prevents the processor from reordering memory operations as follows: If a read or write appears after this method in the code, the processor cannot move it before this method.
public:
 static short VolatileRead(short % address);[System.Obsolete("Thread.VolatileRead and Thread.VolatileWrite are obsolete. Use Volatile.Read or Volatile.Write respectively instead.", DiagnosticId="SYSLIB0054", UrlFormat="https://aka.ms/dotnet-warnings/{0}")]
public static short VolatileRead(ref short address);public static short VolatileRead(ref short address);[<System.Obsolete("Thread.VolatileRead and Thread.VolatileWrite are obsolete. Use Volatile.Read or Volatile.Write respectively instead.", DiagnosticId="SYSLIB0054", UrlFormat="https://aka.ms/dotnet-warnings/{0}")>]
static member VolatileRead : int16 -> int16static member VolatileRead : int16 -> int16Public Shared Function VolatileRead (ByRef address As Short) As ShortParameters
- address
- Int16
The field to be read.
Returns
The value that was read.
- Attributes
Remarks
Thread.VolatileRead and Thread.VolatileWrite are legacy APIs and have been replaced by Volatile.Read and Volatile.Write. See the Volatile class for more information.
Applies to
VolatileRead(Double)
- Source:
- Thread.cs
- Source:
- Thread.cs
- Source:
- Thread.cs
- Source:
- Thread.cs
Caution
Thread.VolatileRead and Thread.VolatileWrite are obsolete. Use Volatile.Read or Volatile.Write respectively instead.
Reads the value of a field. On systems that require it, inserts a memory barrier that prevents the processor from reordering memory operations as follows: If a read or write appears after this method in the code, the processor cannot move it before this method.
public:
 static double VolatileRead(double % address);[System.Obsolete("Thread.VolatileRead and Thread.VolatileWrite are obsolete. Use Volatile.Read or Volatile.Write respectively instead.", DiagnosticId="SYSLIB0054", UrlFormat="https://aka.ms/dotnet-warnings/{0}")]
public static double VolatileRead(ref double address);public static double VolatileRead(ref double address);[<System.Obsolete("Thread.VolatileRead and Thread.VolatileWrite are obsolete. Use Volatile.Read or Volatile.Write respectively instead.", DiagnosticId="SYSLIB0054", UrlFormat="https://aka.ms/dotnet-warnings/{0}")>]
static member VolatileRead : double -> doublestatic member VolatileRead : double -> doublePublic Shared Function VolatileRead (ByRef address As Double) As DoubleParameters
- address
- Double
The field to be read.
Returns
The value that was read.
- Attributes
Remarks
Thread.VolatileRead and Thread.VolatileWrite are legacy APIs and have been replaced by Volatile.Read and Volatile.Write. See the Volatile class for more information.
Applies to
VolatileRead(Byte)
- Source:
- Thread.cs
- Source:
- Thread.cs
- Source:
- Thread.cs
- Source:
- Thread.cs
Caution
Thread.VolatileRead and Thread.VolatileWrite are obsolete. Use Volatile.Read or Volatile.Write respectively instead.
Reads the value of a field. On systems that require it, inserts a memory barrier that prevents the processor from reordering memory operations as follows: If a read or write appears after this method in the code, the processor cannot move it before this method.
public:
 static System::Byte VolatileRead(System::Byte % address);[System.Obsolete("Thread.VolatileRead and Thread.VolatileWrite are obsolete. Use Volatile.Read or Volatile.Write respectively instead.", DiagnosticId="SYSLIB0054", UrlFormat="https://aka.ms/dotnet-warnings/{0}")]
public static byte VolatileRead(ref byte address);public static byte VolatileRead(ref byte address);[<System.Obsolete("Thread.VolatileRead and Thread.VolatileWrite are obsolete. Use Volatile.Read or Volatile.Write respectively instead.", DiagnosticId="SYSLIB0054", UrlFormat="https://aka.ms/dotnet-warnings/{0}")>]
static member VolatileRead : byte -> bytestatic member VolatileRead : byte -> bytePublic Shared Function VolatileRead (ByRef address As Byte) As ByteParameters
- address
- Byte
The field to be read.
Returns
The value that was read.
- Attributes
Remarks
Thread.VolatileRead and Thread.VolatileWrite are legacy APIs and have been replaced by Volatile.Read and Volatile.Write. See the Volatile class for more information.
Applies to
VolatileRead(Int32)
- Source:
- Thread.cs
- Source:
- Thread.cs
- Source:
- Thread.cs
- Source:
- Thread.cs
Caution
Thread.VolatileRead and Thread.VolatileWrite are obsolete. Use Volatile.Read or Volatile.Write respectively instead.
Reads the value of a field. On systems that require it, inserts a memory barrier that prevents the processor from reordering memory operations as follows: If a read or write appears after this method in the code, the processor cannot move it before this method.
public:
 static int VolatileRead(int % address);[System.Obsolete("Thread.VolatileRead and Thread.VolatileWrite are obsolete. Use Volatile.Read or Volatile.Write respectively instead.", DiagnosticId="SYSLIB0054", UrlFormat="https://aka.ms/dotnet-warnings/{0}")]
public static int VolatileRead(ref int address);public static int VolatileRead(ref int address);[<System.Obsolete("Thread.VolatileRead and Thread.VolatileWrite are obsolete. Use Volatile.Read or Volatile.Write respectively instead.", DiagnosticId="SYSLIB0054", UrlFormat="https://aka.ms/dotnet-warnings/{0}")>]
static member VolatileRead : int -> intstatic member VolatileRead : int -> intPublic Shared Function VolatileRead (ByRef address As Integer) As IntegerParameters
- address
- Int32
The field to be read.
Returns
The value that was read.
- Attributes
Remarks
Thread.VolatileRead and Thread.VolatileWrite are legacy APIs and have been replaced by Volatile.Read and Volatile.Write. See the Volatile class for more information.