On Windows, the PeekNamedPipe will as expected immediately return, but this has
the negative side effect of making the select function a busy loop,
effectively using a full core. In the case of buck, this ultimately causes compiling to
be slower than they should be.
As a workaround, let's just sleep a bit in select if nothing can be read from
the named pipe.
On Windows, the PeekNamedPipe will as expected immediately return, but this has the negative side effect of making the
select
function a busy loop, effectively using a full core. In the case of buck, this ultimately causes compiling to be slower than they should be.As a workaround, let's just sleep a bit in select if nothing can be read from the named pipe.