Remove all concurrency code
Muddled the code too much, and only gave a marginal performance improvement in the grand scheme of things. Other ways to parallelize MCTS will be nicer to implement and could yield better results.
This commit is contained in:
@@ -124,28 +124,4 @@ internal static class Intrinsics
|
||||
result[i] = MathF.ReciprocalSqrtEstimate(data[i]);
|
||||
return new(result);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static void CASMax(ref float location, float newValue)
|
||||
{
|
||||
float snapshot;
|
||||
do
|
||||
{
|
||||
snapshot = location;
|
||||
if (snapshot >= newValue) return;
|
||||
} while (Interlocked.CompareExchange(ref location, newValue, snapshot) != snapshot);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static void CASAdd(ref float location, float value)
|
||||
{
|
||||
float snapshot;
|
||||
float newValue;
|
||||
do
|
||||
{
|
||||
snapshot = location;
|
||||
newValue = snapshot + value;
|
||||
}
|
||||
while (Interlocked.CompareExchange(ref location, newValue, snapshot) != snapshot);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user