Thread.VolatileWrite Method

Definition

Writes a value to 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 before this method in the code, the processor cannot move it after this method.

Overloads

VolatileWrite(UIntPtr, UIntPtr)
Obsolete.

Writes a value to 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 before this method in the code, the processor cannot move it after this method.

VolatileWrite(UInt64, UInt64)
Obsolete.

Writes a value to 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 before this method in the code, the processor cannot move it after this method.

VolatileWrite(UInt32, UInt32)
Obsolete.

Writes a value to 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 before this method in the code, the processor cannot move it after this method.

VolatileWrite(UInt16, UInt16)
Obsolete.

Writes a value to 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 before this method in the code, the processor cannot move it after this method.

VolatileWrite(Single, Single)
Obsolete.

Writes a value to 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 before this method in the code, the processor cannot move it after this method.

VolatileWrite(SByte, SByte)
Obsolete.

Writes a value to 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 before this method in the code, the processor cannot move it after this method.

VolatileWrite(Object, Object)
Obsolete.

Writes a value to 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 before this method in the code, the processor cannot move it after this method.

VolatileWrite(IntPtr, IntPtr)
Obsolete.

Writes a value to 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 before this method in the code, the processor cannot move it after this method.

VolatileWrite(Int16, Int16)
Obsolete.

Writes a value to 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 before this method in the code, the processor cannot move it after this method.

VolatileWrite(Int32, Int32)
Obsolete.

Writes a value to 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 before this method in the code, the processor cannot move it after this method.

VolatileWrite(Double, Double)
Obsolete.

Writes a value to 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 before this method in the code, the processor cannot move it after this method.

VolatileWrite(Byte, Byte)
Obsolete.

Writes a value to 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 before this method in the code, the processor cannot move it after this method.

VolatileWrite(Int64, Int64)
Obsolete.

Writes a value to 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 before this method in the code, the processor cannot move it after this method.

VolatileWrite(UIntPtr, UIntPtr)

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.

Writes a value to 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 before this method in the code, the processor cannot move it after this method.

C#
[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 void VolatileWrite(ref UIntPtr address, UIntPtr value);
C#
[System.CLSCompliant(false)]
public static void VolatileWrite(ref UIntPtr address, UIntPtr value);

Parameters

address
UIntPtr

The field to which the value is to be written.

value
UIntPtr

The value to be written.

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

.NET 10 and other versions
Product Versions (Obsolete)
.NET Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8 (9, 10)
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0, 2.1

VolatileWrite(UInt64, UInt64)

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.

Writes a value to 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 before this method in the code, the processor cannot move it after this method.

C#
[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 void VolatileWrite(ref ulong address, ulong value);
C#
[System.CLSCompliant(false)]
public static void VolatileWrite(ref ulong address, ulong value);

Parameters

address
UInt64

The field to which the value is to be written.

value
UInt64

The value to be written.

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

.NET 10 and other versions
Product Versions (Obsolete)
.NET Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8 (9, 10)
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0, 2.1

VolatileWrite(UInt32, UInt32)

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.

Writes a value to 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 before this method in the code, the processor cannot move it after this method.

C#
[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 void VolatileWrite(ref uint address, uint value);
C#
[System.CLSCompliant(false)]
public static void VolatileWrite(ref uint address, uint value);

Parameters

address
UInt32

The field to which the value is to be written.

value
UInt32

The value to be written.

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

.NET 10 and other versions
Product Versions (Obsolete)
.NET Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8 (9, 10)
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0, 2.1

VolatileWrite(UInt16, UInt16)

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.

Writes a value to 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 before this method in the code, the processor cannot move it after this method.

C#
[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 void VolatileWrite(ref ushort address, ushort value);
C#
[System.CLSCompliant(false)]
public static void VolatileWrite(ref ushort address, ushort value);

Parameters

address
UInt16

The field to which the value is to be written.

value
UInt16

The value to be written.

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

.NET 10 and other versions
Product Versions (Obsolete)
.NET Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8 (9, 10)
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0, 2.1

VolatileWrite(Single, Single)

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.

Writes a value to 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 before this method in the code, the processor cannot move it after this method.

C#
[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 void VolatileWrite(ref float address, float value);
C#
public static void VolatileWrite(ref float address, float value);

Parameters

address
Single

The field to which the value is to be written.

value
Single

The value to be written.

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

.NET 10 and other versions
Product Versions (Obsolete)
.NET Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8 (9, 10)
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0, 2.1

VolatileWrite(SByte, SByte)

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.

Writes a value to 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 before this method in the code, the processor cannot move it after this method.

C#
[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 void VolatileWrite(ref sbyte address, sbyte value);
C#
[System.CLSCompliant(false)]
public static void VolatileWrite(ref sbyte address, sbyte value);

Parameters

address
SByte

The field to which the value is to be written.

value
SByte

The value to be written.

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

.NET 10 and other versions
Product Versions (Obsolete)
.NET Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8 (9, 10)
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0, 2.1

VolatileWrite(Object, Object)

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.

Writes a value to 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 before this method in the code, the processor cannot move it after this method.

C#
[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 void VolatileWrite(ref object? address, object? value);
C#
public static void VolatileWrite(ref object? address, object? value);
C#
public static void VolatileWrite(ref object address, object value);

Parameters

address
Object

The field to which the value is to be written.

value
Object

The value to be written.

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

.NET 10 and other versions
Product Versions (Obsolete)
.NET Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8 (9, 10)
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0, 2.1

VolatileWrite(IntPtr, IntPtr)

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.

Writes a value to 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 before this method in the code, the processor cannot move it after this method.

C#
[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 void VolatileWrite(ref IntPtr address, IntPtr value);
C#
public static void VolatileWrite(ref IntPtr address, IntPtr value);

Parameters

address
IntPtr

The field to which the value is to be written.

value
IntPtr

The value to be written.

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

.NET 10 and other versions
Product Versions (Obsolete)
.NET Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8 (9, 10)
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0, 2.1

VolatileWrite(Int16, Int16)

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.

Writes a value to 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 before this method in the code, the processor cannot move it after this method.

C#
[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 void VolatileWrite(ref short address, short value);
C#
public static void VolatileWrite(ref short address, short value);

Parameters

address
Int16

The field to which the value is to be written.

value
Int16

The value to be written.

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

.NET 10 and other versions
Product Versions (Obsolete)
.NET Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8 (9, 10)
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0, 2.1

VolatileWrite(Int32, Int32)

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.

Writes a value to 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 before this method in the code, the processor cannot move it after this method.

C#
[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 void VolatileWrite(ref int address, int value);
C#
public static void VolatileWrite(ref int address, int value);

Parameters

address
Int32

The field to which the value is to be written.

value
Int32

The value to be written.

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

.NET 10 and other versions
Product Versions (Obsolete)
.NET Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8 (9, 10)
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0, 2.1

VolatileWrite(Double, Double)

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.

Writes a value to 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 before this method in the code, the processor cannot move it after this method.

C#
[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 void VolatileWrite(ref double address, double value);
C#
public static void VolatileWrite(ref double address, double value);

Parameters

address
Double

The field to which the value is to be written.

value
Double

The value to be written.

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

.NET 10 and other versions
Product Versions (Obsolete)
.NET Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8 (9, 10)
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0, 2.1

VolatileWrite(Byte, Byte)

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.

Writes a value to 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 before this method in the code, the processor cannot move it after this method.

C#
[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 void VolatileWrite(ref byte address, byte value);
C#
public static void VolatileWrite(ref byte address, byte value);

Parameters

address
Byte

The field to which the value is to be written.

value
Byte

The value to be written.

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

.NET 10 and other versions
Product Versions (Obsolete)
.NET Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8 (9, 10)
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0, 2.1

VolatileWrite(Int64, Int64)

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.

Writes a value to 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 before this method in the code, the processor cannot move it after this method.

C#
[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 void VolatileWrite(ref long address, long value);
C#
public static void VolatileWrite(ref long address, long value);

Parameters

address
Int64

The field to which the value is to be written.

value
Int64

The value to be written.

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

.NET 10 and other versions
Product Versions (Obsolete)
.NET Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8 (9, 10)
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0, 2.1