[*] Expand WakeOnAddress array and minor lookup optimization
This commit is contained in:
parent
43583a1748
commit
0283186046
@ -419,6 +419,8 @@ namespace Aurora::Threading
|
||||
this->uAtomic = 0;
|
||||
}
|
||||
|
||||
#define AddressToIndex AuHashCode(pAddressIDC) & (AuArraySize(this->list) - 1)
|
||||
|
||||
WaitEntry *ProcessWaitContainer::WaitBufferFrom(const void *pAddress, AuUInt8 uSize)
|
||||
{
|
||||
#if defined(FALLBACK_WAKEONADDRESS_SUPPORTS_NONEXACT_MATCHING)
|
||||
@ -426,7 +428,7 @@ namespace Aurora::Threading
|
||||
#else
|
||||
auto pAddressIDC = pAddress;
|
||||
#endif
|
||||
return this->list[AuHashCode(pAddressIDC) % AuArraySize(this->list)].WaitBufferFrom(pAddress, uSize);
|
||||
return this->list[AddressToIndex].WaitBufferFrom(pAddress, uSize);
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
@ -437,7 +439,7 @@ namespace Aurora::Threading
|
||||
#else
|
||||
auto pAddressIDC = pAddress;
|
||||
#endif
|
||||
return this->list[AuHashCode(pAddressIDC) % AuArraySize(this->list)].IterateWake(callback);
|
||||
return this->list[AddressToIndex].IterateWake(callback);
|
||||
}
|
||||
|
||||
void ProcessWaitContainer::RemoveSelf(const void *pAddress, WaitEntry *pSelf)
|
||||
@ -447,7 +449,7 @@ namespace Aurora::Threading
|
||||
#else
|
||||
auto pAddressIDC = pAddress;
|
||||
#endif
|
||||
return this->list[AuHashCode(pAddressIDC) % AuArraySize(this->list)].RemoveSelf(pSelf);
|
||||
return this->list[AddressToIndex].RemoveSelf(pSelf);
|
||||
}
|
||||
|
||||
bool IsNativeWaitOnSupported()
|
||||
|
@ -12,7 +12,7 @@
|
||||
|
||||
namespace Aurora::Threading
|
||||
{
|
||||
static const auto kDefaultWaitPerProcess = 64;
|
||||
static const auto kDefaultWaitPerProcess = 128;
|
||||
|
||||
struct WaitState;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user