[*] Two typos and change bPreferEmulatedWakeOnAddress to true under NIX

This commit is contained in:
Reece Wilson 2023-09-20 17:46:48 +01:00
parent 0f62b03da0
commit f59de8b4ae
5 changed files with 34 additions and 22 deletions

View File

@ -264,7 +264,8 @@ namespace Aurora
bool allowChineseCerts {false};
/// Defer to the rationales in the implementation
/// Update 2023: spoilers it had nothing to do with the 2020 russia trolling directly, but who didn't see it coming?
/// Update 2023: spoilers it had nothing to do with the 2022 russian trolling directly, but who didn't see it coming?
/// i dont care about politics; its just useful to divide the glow by factions.
bool allowRussianCerts {true};
};
@ -368,16 +369,20 @@ namespace Aurora
AuUInt64 bPreferLinuxSemaphoreSpinTryLock : 1 { true };
AuUInt64 bPreferLinuxMutexSpinTryLock : 1 { true };
AuUInt64 bPreferLinuxCondMutexSpinTryLock : 1 { true };
#if 0
AuUInt64 bPreferEmulatedWakeOnAddress : 1 { false };
#else
AuUInt64 bPreferEmulatedWakeOnAddress : 1 { !AuBuild::kIsNtDerived /*everybody else requires us to hit the kernel. */ };
#endif
AuUInt64 bPreferWaitOnAddressAlwaysSpin : 1 { true }; // ..., if emulated! if double-spinning under higher level locks, disable me.
AuUInt64 bPreferRWLockReadLockSpin : 1 { true };
AuUInt64 bUWPNanosecondEmulationCheckFirst : 1 { false };
AuUInt64 uUWPNanosecondEmulationMaxYields : 7 { 12 };
AuUInt64 bForceEnableAdaptiveSpin : 1 { false }; // ||
AuUInt64 bPreferEnableAdaptiveSpin : 1 { true }; // &&
AuUInt64 bPreferLinuxAdaptiveSpin : 1 { true }; // &&
AuUInt64 bPreferOldWin32AdaptiveSpin : 1 { false };
AuUInt64 bPreferNewWin32AdaptiveSpin : 1 { true };
AuUInt64 bPreferEnableAdaptiveSpin : 1 { true }; // .
AuUInt64 bPreferLinuxAdaptiveSpin : 1 { true }; // (&&)
AuUInt64 bPreferOldWin32AdaptiveSpin : 1 { false }; // (&&)
AuUInt64 bPreferNewWin32AdaptiveSpin : 1 { true }; // (&&)
AuUInt64 uAdaptiveSpinCUCnt0 : 4 { 0 } ;
AuUInt64 uAdaptiveSpinCUCnt4 : 4 { 2 };
AuUInt64 uAdaptiveSpinCUCnt8 : 4 { 2 };

View File

@ -51,5 +51,5 @@ namespace Aurora::Threading::Primitives
AUKN_SHARED_SOO2_NCM(ConditionVariable, IConditionVariable, kPrimitiveSizeCond,
((const AuSPtr<IConditionMutex>&, pMutex)),
const AuSPtr<IConditionMutex> &mutex);
const AuSPtr<IConditionMutex> &pMutex);
}

View File

@ -29,7 +29,7 @@ namespace Aurora::Threading::Primitives
virtual void Reset() = 0;
virtual void Set() = 0;
virtual bool TrySet() = 0; // returns false on bPermitMultipleTriggers volation
virtual bool TrySet() = 0; // returns false on bPermitMultipleTriggers violation
};
AUKN_SHARED_SOO2_NCM(Event, IEvent, kPrimitiveSizeEvent,

View File

@ -354,14 +354,20 @@ namespace Aurora::Threading
return this->list[AuHashCode(pAddressIDC) % AuArraySize(this->list)].IterateWake(callback);
}
AUKN_SYM bool IsWaitOnRecommended()
{
if (Primitives::ThrdCfg::gPreferEmulatedWakeOnAddress)
bool IsNativeWaitOnSupported()
{
#if defined(AURORA_IS_MODERNNT_DERIVED)
return pWaitOnAddress &&
AuSwInfo::IsWindows8Point1OrGreater();
#elif defined(AURORA_PLATFORM_LINUX)
return true;
#else
return false;
#endif
}
#if defined(AURORA_IS_MODERNNT_DERIVED)
AUKN_SYM bool IsWaitOnRecommended()
{
static AuOptionalEx<bool> gIsWaitOnRecommendedCache {};
if (gIsWaitOnRecommendedCache)
@ -369,14 +375,14 @@ namespace Aurora::Threading
return gIsWaitOnRecommendedCache.value();
}
bool bState = pWaitOnAddress &&
AuSwInfo::IsWindows8Point1OrGreater();
if (Primitives::ThrdCfg::gPreferEmulatedWakeOnAddress)
{
return false;
}
bool bState = IsNativeWaitOnSupported();
gIsWaitOnRecommendedCache = bState;
return bState;
#elif defined(AURORA_PLATFORM_LINUX)
return true;
#endif
return false;
}
/// @deprecated

View File

@ -70,7 +70,7 @@ namespace Aurora::Threading
Primitives::InitAdaptiveThreshold();
}
AUKN_SYM bool IsWaitOnRecommended();
bool IsNativeWaitOnSupported();
}
namespace Aurora::Threading::Primitives
@ -79,7 +79,8 @@ namespace Aurora::Threading::Primitives
{
auto uCores = AuHwInfo::GetCPUInfo().uThreads;
bool bPermitWOAInternal = IsWaitOnRecommended();
bool bPermitWOAInternal = IsNativeWaitOnSupported();
gUseFutexRWLock = ThrdCfg::gPreferFutexRWLock &&
bPermitWOAInternal;