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

Add pidfd-based implementation #29

Open
Aaron1011 opened this issue Feb 9, 2022 · 0 comments
Open

Add pidfd-based implementation #29

Aaron1011 opened this issue Feb 9, 2022 · 0 comments

Comments

@Aaron1011
Copy link

The current unix implementation of relies on handling SIGCHLD signals. This requires that the corresponding signal handler be properly set up - if another library in the process modifies it, it will be impossible to properly wait on child processes.

On recent versions of Linux, it's possible to use pidfds to avoid this problem. Using the libstd support (rust-lang/rust#81825), we can create a pidfd at the same time that a child is spawned. The pidfd can then be waited on using epoll or select (with an optional timeout).

See tokio-rs/tokio#4016 for additional discussion of the benefits of this approach

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant