[*] Adjust non-AURORA_RUNTIME_FORCE_ADAPTIVE_FUTEX futexes
This commit is contained in:
parent
213ed6c49b
commit
3d8dd991e0
@ -186,9 +186,21 @@ namespace Aurora::Threading::Waitables
|
||||
|
||||
#if (defined(AURORA_ARCH_X86) || defined(AURORA_ARCH_X64)) && !defined(AURORA_RUNTIME_FORCE_ADAPTIVE_FUTEX)
|
||||
AuUInt uCount(GetTotalSpinCountTimeout());
|
||||
#if defined(AURORA_ARCH_X64) || defined(AURORA_ARCH_X86)
|
||||
auto uPerfCounter = __rdtsc() + uCount;
|
||||
while (__rdtsc() < uPerfCounter)
|
||||
#else
|
||||
for (AU_ITERATE_N(i, uCount))
|
||||
#endif
|
||||
{
|
||||
#if defined(AURORA_ARCH_X64) || defined(AURORA_ARCH_X86)
|
||||
_mm_pause();
|
||||
_mm_pause();
|
||||
_mm_pause();
|
||||
_mm_pause();
|
||||
#else
|
||||
// TBD
|
||||
#endif
|
||||
|
||||
if (TryLock3())
|
||||
{
|
||||
|
@ -34,9 +34,21 @@ namespace Aurora::Threading::Waitables
|
||||
|
||||
#if (defined(AURORA_ARCH_X86) || defined(AURORA_ARCH_X64)) && !defined(AURORA_RUNTIME_FORCE_ADAPTIVE_FUTEX)
|
||||
AuUInt uCount(GetTotalSpinCountTimeout());
|
||||
#if defined(AURORA_ARCH_X64) || defined(AURORA_ARCH_X86)
|
||||
auto uPerfCounter = __rdtsc() + uCount;
|
||||
while (__rdtsc() < uPerfCounter)
|
||||
#else
|
||||
for (AU_ITERATE_N(i, uCount))
|
||||
#endif
|
||||
{
|
||||
#if defined(AURORA_ARCH_X64) || defined(AURORA_ARCH_X86)
|
||||
_mm_pause();
|
||||
_mm_pause();
|
||||
_mm_pause();
|
||||
_mm_pause();
|
||||
#else
|
||||
// TBD
|
||||
#endif
|
||||
|
||||
if (TryLockNoSpin())
|
||||
{
|
||||
|
@ -33,9 +33,21 @@ namespace Aurora::Threading::Waitables
|
||||
|
||||
#if (defined(AURORA_ARCH_X86) || defined(AURORA_ARCH_X64)) && !defined(AURORA_RUNTIME_FORCE_ADAPTIVE_FUTEX)
|
||||
AuUInt uCount(GetTotalSpinCountTimeout());
|
||||
#if defined(AURORA_ARCH_X64) || defined(AURORA_ARCH_X86)
|
||||
auto uPerfCounter = __rdtsc() + uCount;
|
||||
while (__rdtsc() < uPerfCounter)
|
||||
#else
|
||||
for (AU_ITERATE_N(i, uCount))
|
||||
#endif
|
||||
{
|
||||
#if defined(AURORA_ARCH_X64) || defined(AURORA_ARCH_X86)
|
||||
_mm_pause();
|
||||
_mm_pause();
|
||||
_mm_pause();
|
||||
_mm_pause();
|
||||
#else
|
||||
// TBD
|
||||
#endif
|
||||
|
||||
if (TryLockNoSpin())
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user