find a way to create Thread binded to LogicalCore properly

This commit is contained in:
Youmu Liu
2026-04-14 18:08:22 +08:00
parent b07013a003
commit fdf11c729f
15 changed files with 228 additions and 254 deletions
@@ -67,13 +67,15 @@ namespace StgSharp.Common.HighPerformance.ProcessorAbstraction
return [];
}
T[][] arr = new T[_numaNodes.Length][];
foreach (NumaNode node in _numaNodes)
for (int i = 0; i < _numaNodes.Length; i++)
{
NumaNode node = _numaNodes[i];
T[] values = new T[node.LogicalCoreCount];
ReadOnlySpan<LogicalCore> cores = node.LogicalCores;
for (int i = 0; i < cores.Length; i++) {
values[i] = factory(cores[i]);
for (int j = 0; j < cores.Length; j++) {
values[j] = factory(cores[j]);
}
arr[i] = values;
}
return arr;
}