From: Sam S. <sd...@gn...> - 2009-07-10 04:33:23
|
> * Bruno Haible <oe...@py...t> [2009-07-10 02:38:27 +0200]: > > Sam Steingold wrote: >> it turned out that I needed to wrap wait() in begin_want_sigcld/end_want_sigcld > > Calling begin_want_sigcld/end_want_sigcld inside the WAIT function is not > enough, because it leads to a race condition: If, in > > (progn > (ext::launch "sleep" :arguments '("10") :wait nil :output nil) > ; --> the subprocess dies here <-- > (wait :usage t :untraced t :continued t)) > > the subprocess dies before the WAIT call, WAIT will hang forever. nope, wait will return immediately (with an ECHILD). which is, of course, suboptimal. maybe we should always accept SIGCHLD? of course, this would mean that we would have to spawn a waitpid thread for each "junk" process (pipes &c). -- Sam Steingold (http://sds.podval.org/) on Ubuntu 9.04 (jaunty) http://memri.org http://truepeace.org http://www.memritv.org http://ffii.org http://camera.org http://openvotingconsortium.org Those who don't know lisp are destined to reinvent it, poorly. |