Daily update on 20250921-173333 by Nitload Youmu. Additional Message : New design of matrix enumeration, capable for parallel task publication.
Signed-off-by: Nitload <YoumuLiu_NSI@whv0t.onmicrosoft.com>
This commit is contained in:
@@ -57,45 +57,13 @@ namespace StgSharp
|
||||
|
||||
// 7. 线程状态监控测试
|
||||
Console.WriteLine("=== 线程状态监控测试 ===");
|
||||
TestThreadStateMonitoring();
|
||||
|
||||
// TestThreadStateMonitoring();
|
||||
Console.WriteLine();
|
||||
|
||||
Console.WriteLine("? MatrixParallel 分层线程调度系统空跑测试完成");
|
||||
}
|
||||
|
||||
private static bool TestInitialization()
|
||||
{
|
||||
if (!MatrixParallel.SupportParallel)
|
||||
{
|
||||
Console.WriteLine("? 跳过初始化测试 - 系统不支持并行处理");
|
||||
return false;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
Console.WriteLine("正在初始化 MatrixParallel...");
|
||||
MatrixParallel.Init();
|
||||
Console.WriteLine("? MatrixParallel 初始化成功");
|
||||
|
||||
|
||||
// 检查 LeaderHandle 是否正确设置
|
||||
if (MatrixParallel.LeaderHandle != null)
|
||||
{
|
||||
Console.WriteLine($"? LeaderHandle 已创建,Wrap ID: {MatrixParallel.LeaderHandle.Wrap.ID}");
|
||||
} else
|
||||
{
|
||||
Console.WriteLine("? LeaderHandle 未正确设置");
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine($"? 初始化失败: {ex.Message}");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
private static void TestParallelControlFlow()
|
||||
{
|
||||
try
|
||||
@@ -121,7 +89,7 @@ namespace StgSharp
|
||||
MatrixParallel.SetAllWrap();
|
||||
|
||||
// 发布任务(空任务)
|
||||
MatrixParallel.PublishTask();
|
||||
// MatrixParallel.PublishTask();
|
||||
|
||||
// 短暂等待,模拟实际工作
|
||||
Thread.Sleep(10 + i * 5);
|
||||
@@ -162,7 +130,8 @@ namespace StgSharp
|
||||
|
||||
MatrixParallel.LaunchParallel(SleepMode.QuickWakeup);
|
||||
MatrixParallel.SetAllWrap();
|
||||
MatrixParallel.PublishTask();
|
||||
|
||||
// MatrixParallel.PublishTask();
|
||||
|
||||
|
||||
// 极短暂的等待
|
||||
|
||||
Reference in New Issue
Block a user