diff options
author | Dave Parks <davep@lindenlab.com> | 2022-11-30 13:25:00 -0600 |
---|---|---|
committer | Dave Parks <davep@lindenlab.com> | 2022-11-30 13:25:00 -0600 |
commit | 87bb72a47a1fc64b98e498120e332de76e6a9211 (patch) | |
tree | 1e48ca7915525368bf3eda06447ab4edcaf0be60 /indra/llcommon/llqueuedthread.cpp | |
parent | adbd264d35f5fabe28249839da6c12e5dac4127f (diff) |
SL-18154 WIP -- CPU sampling (AMD uProf) profile guided optimizations to reduce CPU usage of background threads.
Diffstat (limited to 'indra/llcommon/llqueuedthread.cpp')
-rw-r--r-- | indra/llcommon/llqueuedthread.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/indra/llcommon/llqueuedthread.cpp b/indra/llcommon/llqueuedthread.cpp index e5060a1076..9b1de2e9a5 100644 --- a/indra/llcommon/llqueuedthread.cpp +++ b/indra/llcommon/llqueuedthread.cpp @@ -477,9 +477,14 @@ void LLQueuedThread::processRequest(LLQueuedThread::QueuedRequest* req) mRequestQueue.post([=] { LL_PROFILE_ZONE_NAMED("processRequest - retry"); - while (LL::WorkQueue::TimePoint::clock::now() < retry_time) + if (LL::WorkQueue::TimePoint::clock::now() < retry_time) { - std::this_thread::yield(); //note: don't use LLThread::yield here to avoid + auto sleep_time = std::chrono::duration_cast<std::chrono::milliseconds>(retry_time - LL::WorkQueue::TimePoint::clock::now()); + + if (sleep_time.count() > 0) + { + ms_sleep(sleep_time.count()); + } } processRequest(req); }); |