[*] adjust tls coefficients

This commit is contained in:
Reece Wilson 2023-04-30 14:46:36 +01:00
parent 7c1a1566fd
commit fca5b90b85

View File

@ -13,7 +13,7 @@ namespace Aurora::Threading::Threads
{
static AuUInt32 uAtomicCounter {};
static thread_local AuUInt32 tlsThreadIndex { };
static const auto kMaxMaxLinearThreads = AuNumericLimits<AuUInt16>::max() / 2;
static const auto kMaxMaxLinearThreads = AuNumericLimits<AuUInt16>::max() / 10;
AuUInt32 GetThreadKey()
{
@ -49,7 +49,7 @@ namespace Aurora::Threading::Threads
{
// 256 bytes, less than some of microsofts stupid stl thread primitives
// so, ill take this as acceptable
/*void **/ ViewEntry table[32];
/*void **/ ViewEntry table[64];
AuThreadPrimitives::Mutex mutex;
AuList<AuSPtr<ViewEntry>> ptrs;
@ -93,13 +93,13 @@ namespace Aurora::Threading::Threads
uKey -= AuArraySize(this->table);
if (uKey >= ptrs.size())
if (uKey >= this->ptrs.size())
{
ptrs.reserve(uKey * 2);
ptrs.resize(uKey);
this->ptrs.reserve(uKey * 2);
this->ptrs.resize(uKey);
}
auto &sharedRef = ptrs[uKey];
auto &sharedRef = this->ptrs[uKey];
if (!sharedRef)
{
sharedRef = AuMakeSharedPanic<ViewEntry>();