DotNext by Roman Sakno

<PackageReference Include="DotNext" Version="0.1.0" />

 AtomicDouble

public static class AtomicDouble
Various atomic operations for Double data type accessible as extension methods.
public static double AccumulateAndGet(this ref double value, double x, Func<double, double, double> accumulator)

Atomically updates the current value with the results of applying the given function to the current and given values, returning the updated value.

public static double AccumulateAndGet(this double[] array, long index, double x, Func<double, double, double> accumulator)

Atomically updates the array element with the results of applying the given function to the array element and given values, returning the updated value.

public static double Add(this ref double value, double operand)

Adds two 64-bit floating-point numbers and replaces referenced storage with the sum, as an atomic operation.

public static double Add(this double[] array, long index, double operand)

Adds two 64-bit integers and replaces array element with the sum, as an atomic operation.

public static bool CompareAndSet(this ref double value, double expected, double update)

Atomically sets referenced value to the given updated value if the current value == the expected value.

public static bool CompareAndSet(this double[] array, long index, double expected, double update)

Atomically sets array element to the given updated value if the array element == the expected value.

public static long CompareExchange(this long[] array, long index, long update, long comparand)

Atomically sets array element to the given updated value if the array element == the expected value.

public static double DecrementAndGet(this ref double value)

Atomically decrements by one the current value.

public static double DecrementAndGet(this double[] array, long index)

Atomically decrements the array element by one.

public static double GetAndAccumulate(this ref double value, double x, Func<double, double, double> accumulator)

Atomically updates the current value with the results of applying the given function to the current and given values, returning the original value.

public static double GetAndAccumulate(this double[] array, long index, double x, Func<double, double, double> accumulator)

Atomically updates the array element with the results of applying the given function to the array element and given values, returning the original value.

public static double GetAndSet(this ref double value, double update)

Modifies referenced value atomically.

public static double GetAndSet(this double[] array, long index, double update)

Modifies the array element atomically.

public static double GetAndUpdate(this ref double value, Func<double, double> updater)

Atomically updates the stored value with the results of applying the given function, returning the original value.

public static double GetAndUpdate(this double[] array, long index, Func<double, double> updater)

Atomically updates the array element with the results of applying the given function, returning the original value.

public static double IncrementAndGet(this ref double value)

Atomically increments by one referenced value.

public static double IncrementAndGet(this double[] array, long index)

Atomically increments the array element by one.

public static double SetAndGet(this ref double value, double update)

Modifies value atomically.

public static double SetAndGet(this double[] array, long index, double update)

Modifies the array element atomically.

public static double UpdateAndGet(this ref double value, Func<double, double> updater)

Atomically updates the stored value with the results of applying the given function, returning the updated value.

public static double UpdateAndGet(this double[] array, long index, Func<double, double> updater)

Atomically updates the array element with the results of applying the given function, returning the updated value.

public static double VolatileGet(this ref double value)

Reads the value of the specified 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 VolatileGet(this double[] array, long index)

Performs volatile read of the array element.

public static void VolatileSet(this ref double value, double newValue)

Writes the specified value to the specified 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.

public static void VolatileSet(this double[] array, long index, double value)

Performs volatile write to the array element.