pipeline: Don't use Sleep(1) to yield on Windows

Use Sleep(0) instead.  Sleep(0) is not guaranteed to yield, which is a problem, but Sleep(1) can easily take up to 16 ms, which is really unacceptable except in very low-priority thread.  But really, you shouldn't be relying on force_yield() for anything except with the SIMPLE_THREADS model.

There is also SwitchToThread(), but in fact it is even weaker than Sleep(0).
This commit is contained in:
rdb 2022-02-23 21:49:35 +01:00
parent cb8563acac
commit c2d088f232

View File

@ -76,7 +76,7 @@ sleep(double seconds) {
*/
INLINE void ThreadWin32Impl::
yield() {
Sleep(1);
Sleep(0);
}
/**