L4 briefly pass unit test

This commit is contained in:
Youmu Liu
2026-03-18 17:53:28 +08:00
parent dccb815811
commit e3f2cf989d
12 changed files with 69 additions and 25 deletions
@@ -26,6 +26,7 @@
// -----------------------------------------------------------------------
// -----------------------------------------------------------------------
using Microsoft.VisualBasic.FileIO;
using StgSharp.HighPerformance.Memory;
using StgSharp.Mathematics.Internal;
using System;
using System.Collections.Concurrent;
@@ -41,6 +42,8 @@ namespace StgSharp.Mathematics.Numeric
internal unsafe class MatrixParallelQueue
{
// TODO 为各种不同的计算策略设计专门的预测器,以适配L4
private static ConcurrentStack<MatrixParallelQueue> _recycle = [];
private MatrixParallelTask* _package;
private ulong _cursor;
@@ -105,7 +105,7 @@ namespace StgSharp.Mathematics.Numeric
public void WaitAllWraps()
{
if (_disposed) {
throw new ObjectDisposedException(typeof(MatrixParallelWrap).Name);
throw new ObjectDisposedException(nameof(MatrixParallelWrap));
}
SpinWait.SpinUntil(() => Volatile.Read(ref _count) == 0);
}
@@ -114,7 +114,7 @@ namespace StgSharp.Mathematics.Numeric
internal void ReportThreadAccomplished()
{
if (_disposed) {
throw new ObjectDisposedException(typeof(MatrixParallelWrap).Name);
throw new ObjectDisposedException(nameof(MatrixParallelWrap));
}
Interlocked.Decrement(ref _count);
}