Commit a53000b0 by Geoff Lang

Try Sleep(1) instead of Sleep(0) while waiting for queries.

On a loaded machine, Sleep(0) can be very slow (40+ms) while Sleep(1) is consistantly 1-2ms. BUG=488571 Change-Id: I71de0b4cfc334a2476b7c613c103e77fe759041d Reviewed-on: https://chromium-review.googlesource.com/273183Reviewed-by: 's avatarShannon Woods <shannonwoods@chromium.org> Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Tested-by: 's avatarGeoff Lang <geofflang@chromium.org>
parent 4dfe8094
...@@ -719,7 +719,10 @@ void ScheduleYield() ...@@ -719,7 +719,10 @@ void ScheduleYield()
// Emulate sleep by waiting with timeout on an event that is never signalled. // Emulate sleep by waiting with timeout on an event that is never signalled.
WaitForSingleObjectEx(sleepEvent, 0, false); WaitForSingleObjectEx(sleepEvent, 0, false);
#else #else
Sleep(0); if (SwitchToThread() == FALSE)
{
Sleep(1);
}
#endif #endif
} }
......
...@@ -614,7 +614,7 @@ gl::Error Renderer9::finish() ...@@ -614,7 +614,7 @@ gl::Error Renderer9::finish()
while (result == S_FALSE) while (result == S_FALSE)
{ {
// Keep polling, but allow other threads to do something useful first // Keep polling, but allow other threads to do something useful first
Sleep(0); ScheduleYield();
result = query->GetData(NULL, 0, D3DGETDATA_FLUSH); result = query->GetData(NULL, 0, D3DGETDATA_FLUSH);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment