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:
Asriel Camora
2023-07-07 20:17:35 +02:00
parent 3ab50d389e
commit 636501ab86
11 changed files with 153 additions and 431 deletions
-24
View File
@@ -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);
}
}