-
Notifications
You must be signed in to change notification settings - Fork 14
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
doesn't seem to work with fork()
#13
Comments
I'm really a beginner in this concurrency topic so I can only utter wild guesses: Could it be that |
Hi! I'm having this issue, too. After a call to let signal = chan_signal::notify(&[Signal::CHLD, Signal::INT, Signal::TERM]);
// Wait for a signal or for work to be done.
chan_select! {
signal.recv() -> signal => {
println!("Received signal: {:?}", signal)
},
} in the parent process. No signal is received from the child process, but the INT signal is received (I generate it when doing Ctrl-C to exit). I'm on macOS 10.12, rust 1.14 and 1.16.0-nightly (83c2d9523 2017-01-24), chan 0.1.18, chan-signal 0.2.0. Cheers, |
My guess is that this has to do with the child process not inheriting the signal masks. |
@BurntSushi Could be. Is Signal::INT by default in the signal mask? |
I don't know. Someone needs to go learn about There isn't much code in this crate, but I don't have time to investigate this issue myself right now. |
@BurntSushi Thanks for the feedback. I need this kind of functionality for a project, so if I find something, I'll post back here. Cheers, |
This crate is now deprecated. See: https://users.rust-lang.org/t/ann-chan-is-deprecated-use-crossbeam-channel-instead/19251 |
I'm trying to mix this chan module together with
libc::fork()
but somehow it doesn't work.This is probably due to some difference between
thread::spawn()
andfork()
but I just don't understand why it should not work.Here's the example from the README adapted to fork(). Interestingly the
INT
signal works but theTERM
not even thoughsdone
is really moved intorun
(this issue moved from here)
The text was updated successfully, but these errors were encountered: