async-process
async-process copied to clipboard
Use a more efficient strategy for waiting on processes
Right now, we use SIGPROC
to wait for process events on Unix and thread pooling to wait for process events on Windows. This is a very inefficient strategy that doesn't scale for many child processes, like using poll()
for I/O notification.
Most operating systems have better ways of handling events like this.
- Linux has
pidfd
, which can be registered directly intoasync-io
. - BSD has
EVFILT_PROC
, which is now exposed inasync-io
. - Windows has waitable handles, which need to be exposed in
async-io
. They can also be made more efficient on thepolling
side, see smol-rs/async-io#25