rust/src/libstd/sys
Alex Crichton 7c3038f824 std: Don't spawn threads in wait_with_output
Semantically there's actually no reason for us to spawn threads as part of the
call to `wait_with_output`, and that's generally an incredibly heavyweight
operation for just reading a few bytes (especially when stderr probably rarely
has bytes!). An equivalent operation in terms of what's implemented today would
be to just drain both pipes of all contents and then call `wait` on the child
process itself.

On Unix we can implement this through some convenient use of the `select`
function, whereas on Windows we can make use of overlapped I/O. Note that on
Windows this requires us to use named pipes instead of anonymous pipes, but
they're semantically the same under the hood.
2016-03-09 10:12:36 -08:00
..
common std: Funnel read_to_end through to one location 2016-03-08 17:45:44 -08:00
unix std: Don't spawn threads in wait_with_output 2016-03-09 10:12:36 -08:00
windows std: Don't spawn threads in wait_with_output 2016-03-09 10:12:36 -08:00