[*] SMT Yield: minor branch added to SMT Yield

This commit is contained in:
Reece Wilson 2023-09-09 18:09:22 +01:00
parent 88355932c1
commit dfe44317a0
2 changed files with 4 additions and 1 deletions

View File

@ -81,6 +81,8 @@ namespace Aurora::Threading::Primitives
gUseFutexRWLock = ThrdCfg::gPreferFutexRWLock &&
IsWaitOnRecommended();
gSpinAdaptiveThreadCount = uCores;
if (uCores == 1)
{
gSpinAdaptiveThreshold = 0;

View File

@ -54,6 +54,7 @@ namespace Aurora::Threading::Primitives
inline AuUInt32 gSpinAdaptiveThreshold {};
inline AuUInt32 gSpinAdaptiveCurrentCount {};
inline AuUInt32 gSpinAdaptiveThreadCount {};
inline AuUInt32 gUseFutexRWLock {};
@ -144,7 +145,7 @@ namespace Aurora::Threading::Primitives
AuAtomicSub(&gSpinAdaptiveCurrentCount, 1u);
}
else
else if (uNow <= gSpinAdaptiveThreadCount)
{
auto uCount = (spin) / 3;
#if defined(AURORA_ARCH_X64) || defined(AURORA_ARCH_X86)