world timer supports numa and thread affinity binding

This commit is contained in:
Youmu Liu
2026-08-20 16:53:34 +08:00
parent 843eb6b237
commit 968a6afe1a
19 changed files with 223 additions and 88 deletions
@@ -6,9 +6,11 @@
// -----------------------------------------------------------------------------
using System;
using System.Buffers;
using System.Collections;
using System.Collections.Generic;
using System.Runtime.CompilerServices;
using System.Security.Cryptography;
using System.Threading;
namespace StgSharp.Collections
@@ -122,6 +124,24 @@ namespace StgSharp.Collections
_index += span.Length;
}
public void PushRange(
SpanAction<T, int> filling,
int count
)
{
if (count == 0) {
return;
}
if (_index + count > _values.Length) {
throw new InvalidOperationException("Not enough space in the stack to push the entire span.");
}
if (filling is not null)
{
filling(_values.AsSpan()[_index..(_index + count)], count);
_index += count;
}
}
public bool TryPop(
out T value
)
@@ -163,4 +183,4 @@ namespace StgSharp.Collections
}
}
}
}