Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #18398
| Date | 2012-01-03 13:31 +0100 |
|---|---|
| From | Heiko Wundram <modelnine@modelnine.org> |
| Subject | Re: Avoid race condition with Popen.send_signal |
| References | <mailman.4323.1325545598.27778.python-list@python.org> <e2f96c71-544b-451e-9797-4d6b04438e6a@z17g2000vbe.googlegroups.com> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.4348.1325593922.27778.python-list@python.org> (permalink) |
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.
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Avoid race condition with Popen.send_signal Jérôme <jerome@jolimont.fr> - 2012-01-03 00:09 +0100
Re: Avoid race condition with Popen.send_signal Adam Skutt <askutt@gmail.com> - 2012-01-02 17:19 -0800
Re: Avoid race condition with Popen.send_signal Heiko Wundram <modelnine@modelnine.org> - 2012-01-03 13:31 +0100
Re: Avoid race condition with Popen.send_signal Adam Skutt <askutt@gmail.com> - 2012-01-03 05:40 -0800
Re: Avoid race condition with Popen.send_signal Heiko Wundram <modelnine@modelnine.org> - 2012-01-03 14:56 +0100
csiph-web