Am 03.01.2012 02:19, schrieb Adam Skutt:
On Jan 2, 6:09 pm, Jérôme<jer...@jolimont.fr> wrote:
What is the clean way to avoid this race condition ?
The fundamental race condition cannot be removed nor avoided. Ideally,
avoid the need to send the subprocess a signal in the first place. If
it cannot be avoided, then trap the exception.
Yes, it can be avoided, that's what the default SIGCHLD-handling
(keeping the process as a zombie until it's explicitly collected by a
wait*()) is for, which forces the PID not to be reused by the operating
system until the parent has acknowledged (by actively calling wait*())
that the child has terminated.
--
--- Heiko.
--
http://mail.python.org/mailman/listinfo/python-list