4 ms·
I'm curious, isn't there a race condition in the WCE method, where: (1) The child terminates normally, never having received SIGINT. (2) The parent receives S
by ambrop7 11y ago
I'm curious, isn't there a race condition in the WCE method, where:
(1) The child terminates normally, never having received SIGINT.
(2) The parent receives SIGINT before it reaches the wait() call, or while in the wait() call but before the child termination is picked up (I suppose in the later case wait() might fail and be restarted).
(3) Once the parent sees that the child terminated normally, it does not exit, and SIGINT was effectively ignored.
- davekeck 11y agoI don't see a race -- the article says: "Take no action when SIGINT is received while you wait for a child. You make a note of the fact that you did receive it, though." Then, after waiting on the child, "Look at whether you (the shell) has received SIGINT while the child was in the foreground", and the shell kills itself with SIGINT if so.