-
Notifications
You must be signed in to change notification settings - Fork 35
M_CodeJam_Threading_InterlockedOperations_Update
Andrew Koryavchenko edited this page Jun 17, 2018
·
6 revisions
Implements lock-free update pattern implementation based on compare-and-swap loop
Namespace: CodeJam.Threading
Assembly: CodeJam (in CodeJam.dll) Version: 2.1.0.0
C#
public static double Update(
ref double value,
double newValue,
Func<double, double, double> updateCallback
)
VB
Public Shared Function Update (
ByRef value As Double,
newValue As Double,
updateCallback As Func(Of Double, Double, Double)
) As Double
F#
static member Update :
value : float byref *
newValue : float *
updateCallback : Func<float, float, float> -> float
- value
- Type: System.Double
Value to change. - newValue
- Type: System.Double
Precalculated new value. - updateCallback
- Type: System.Func(Double, Double, Double)
Function to calculate new value.
Type: Double
New value.
Uses the same approach that used by c# compiler in event subscription methods
InterlockedOperations Class
Update Overload
CodeJam.Threading Namespace