Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #18398

Re: Avoid race condition with Popen.send_signal

Path csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!news.albasani.net!newsfeed.freenet.ag!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <modelnine@modelnine.org>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.033
X-Spam-Evidence '*H*': 0.93; '*S*': 0.00; 'exception.': 0.09; 'subprocess': 0.09; 'adam': 0.16; 'ideally,': 0.16; 'received:10.2': 0.16; 'terminated.': 0.16; 'trap': 0.16; 'wrote:': 0.18; 'jan': 0.19; 'header:In-Reply-To:1': 0.22; 'explicitly': 0.29; 'pm,': 0.29; 'for,': 0.30; 'parent': 0.30; '---': 0.31; 'header:User-Agent:1': 0.33; 'to:addr:python-list': 0.34; 'calling': 0.34; 'forces': 0.34; 'fundamental': 0.34; 'operating': 0.35; 'actively': 0.36; 'subject:with': 0.36; '(by': 0.37; 'signal': 0.38; 'received:org': 0.38; "it's": 0.40; 'to:addr:python.org': 0.40; 'race': 0.77; 'avoided.': 0.91
DKIM-Signature v=1; a=rsa-sha256; c=simple/simple; d=modelnine.org; s=modelnine1012; t=1325593921; bh=6mGiwFsXnvJQwhwIe/VCVxNeBVygS6suajAjFu6MdF0=; h=Message-ID:Date:From:MIME-Version:To:Subject:References: In-Reply-To:Content-Type:Content-Transfer-Encoding; b=TTdfwtL75qjd/t7O5sYlEASRpaI5OhU4joDV/utbhZWRR6YFJ5/wjuKVmmiFYbELL cawxIahuxnEPy7wp52xqkChWGMebasy4PGCYV+SrBiokOf9ZbABlekFwg1WQpA8IoI 8XFLxqmVjiLnUXWBXmUY/WPHPV9eicQU8vNoUUBI=
Date Tue, 03 Jan 2012 13:31:55 +0100
From Heiko Wundram <modelnine@modelnine.org>
User-Agent Mozilla/5.0 (Windows NT 6.1; WOW64; rv:10.0) Gecko/20111222 Thunderbird/10.0
MIME-Version 1.0
To python-list@python.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>
In-Reply-To <e2f96c71-544b-451e-9797-4d6b04438e6a@z17g2000vbe.googlegroups.com>
Content-Type text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding 8bit
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.12
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.4348.1325593922.27778.python-list@python.org> (permalink)
Lines 16
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1325593922 news.xs4all.nl 6881 [2001:888:2000:d::a6]:45237
X-Complaints-To abuse@xs4all.nl
Xref x330-a1.tempe.blueboxinc.net comp.lang.python:18398

Show key headers only | View raw


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 | NextPrevious in thread | Next in thread | Find similar | Unroll thread


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