Skip to content

M_CodeJam_Threading_InterlockedOperations_Update_1

andrewvk edited this page Apr 21, 2016 · 6 revisions

InterlockedOperations.Update Method (Double, Func(Double, Double))

[This is preliminary documentation and is subject to change.]

Implements lock-free update pattern implementation based on compare-and-swap loop

Namespace: CodeJam.Threading
Assembly: CodeJam (in CodeJam.dll) Version: 1.0.0.0 (1.0.0.0)

Syntax

C#

public static double Update(
	ref double value,
	Func<double, double> updateCallback
)

VB

Public Shared Function Update ( 
	ByRef value As Double,
	updateCallback As Func(Of Double, Double)
) As Double

F#

static member Update : 
        value : float byref * 
        updateCallback : Func<float, float> -> float 

Parameters

 

value
Type: System.Double
Value to change.
updateCallback
Type: System.Func(Double, Double)
Function to calculate new value.

Return Value

Type: Double
New value.

Remarks

Uses the same approach that used by c# compiler in event subscription methods

See Also

Reference

InterlockedOperations Class
Update Overload
CodeJam.Threading Namespace

Clone this wiki locally