Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use the waiter backend on Windows #87

Merged
merged 2 commits into from
Aug 23, 2024
Merged

Use the waiter backend on Windows #87

merged 2 commits into from
Aug 23, 2024

Conversation

notgull
Copy link
Member

@notgull notgull commented Aug 10, 2024

In async-process, we have a backend that assumes that child processes
are object that can be .awaited on, rather than just being dependent
on signals. At the moment it is only used with Linux and pidfd. Now, it
is used with Windows and the waitable process backend.

At the moment, the backend for Waitable in async-io is just backed
by a blocking threadpool. However it may also be possible to have it use
IOCP too with little extra overhead. See smol-rs/polling#141 for more
information.

As a side effect, this removes our dependency on windows-sys.

@notgull notgull force-pushed the notgull/wait-windows branch 2 times, most recently from 99664ea to adfb279 Compare August 10, 2024 22:54
In async-process, we have a backend that assumes that child processes
are object that can be `.await`ed on, rather than just being dependent
on signals. At the moment it is only used with Linux and pidfd. Now, it
is used with Windows and the waitable process backend.

At the moment, the backend for `Waitable` in `async-io` is just backed
by a blocking threadpool. However it may also be possible to have it use
IOCP too with little extra overhead. See smol-rs/polling#141 for more
information.

As a side effect, this removes our dependency on `windows-sys`.

Signed-off-by: John Nunley <dev@notgull.net>
@notgull notgull force-pushed the notgull/wait-windows branch from adfb279 to 4154e03 Compare August 10, 2024 23:06
@notgull notgull requested a review from fogti August 10, 2024 23:10
Cargo.toml Outdated Show resolved Hide resolved
src/reaper/wait.rs Outdated Show resolved Hide resolved
.github/workflows/ci.yml Show resolved Hide resolved
@fogti
Copy link
Member

fogti commented Aug 12, 2024

what's the overall advantage/benefit of this?

@notgull
Copy link
Member Author

notgull commented Aug 22, 2024

what's the overall advantage/benefit of this?

Better scalability. Now we don't wake every subprocess task in the program whenever one single subprocess finishes.

Signed-off-by: John Nunley <dev@notgull.net>
@notgull notgull requested a review from fogti August 22, 2024 03:36
@notgull notgull merged commit 755aa99 into master Aug 23, 2024
15 checks passed
@notgull notgull deleted the notgull/wait-windows branch August 23, 2024 02:17
@notgull notgull mentioned this pull request Sep 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants