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


Groups > comp.lang.python > #26362

Re: Pass data to a subprocess

Path csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!feeder2.ecngs.de!ecngs!feeder.ecngs.de!xlned.com!feeder7.xlned.com!news2.euro.net!newsfeed.xs4all.nl!newsfeed5.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <gandalf@shopzeus.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.003
X-Spam-Evidence '*H*': 0.99; '*S*': 0.00; 'anyway.': 0.04; 'memory.': 0.05; 'correct.': 0.07; '(although': 0.09; 'linux/unix': 0.09; 'sure)': 0.09; '*and': 0.16; 'call)': 0.16; 'mapped': 0.16; 'pipes': 0.16; 'resource,': 0.16; 'segfault': 0.16; 'segment': 0.16; 'sense,': 0.16; 'up*': 0.16; 'working.': 0.17; '>>>': 0.18; 'memory': 0.18; 'somebody': 0.23; 'header:In-Reply-To:1': 0.25; 'header:User-Agent:1': 0.26; 'implemented': 0.27; 'parent': 0.29; "i'm": 0.29; 'running': 0.32; 'subject:data': 0.33; 'surely': 0.33; 'to:addr:python-list': 0.33; "can't": 0.34; 'process,': 0.35; "won't": 0.35; 'something': 0.35; 'created': 0.36; 'but': 0.36; 'child': 0.36; 'why': 0.37; 'communicate': 0.37; 'subject:: ': 0.38; 'things': 0.38; 'to:addr:python.org': 0.39; 'received:192': 0.39; 'received:192.168': 0.40; 'think': 0.40; 'more': 0.63; 'received:204': 0.72; '100%': 0.76; 'child,': 0.84; 'killed': 0.91
Date Wed, 01 Aug 2012 16:32:04 +0200
From Laszlo Nagy <gandalf@shopzeus.com>
User-Agent Mozilla/5.0 (X11; Linux x86_64; rv:14.0) Gecko/20120714 Thunderbird/14.0
MIME-Version 1.0
To python-list@python.org
Subject Re: Pass data to a subprocess
References <CAF_E5JY5FgEJub7tNNzZEj0tri8Z7oPZUSLOLtD+5f0t7Yv+Yg@mail.gmail.com> <CAF_E5JY2sEsauXM-teW4hTHePqFCYK6z+9oLMZcjVWFyYs+gKg@mail.gmail.com> <5017EFB0.6080608@shopzeus.com> <CAF_E5JaEHxsjKoHRhZLzh+YdPU8UqKHae9efCsP7zEvm_37+2w@mail.gmail.com> <mailman.2809.1343809166.4697.python-list@python.org> <jvbdoj$rat$1@reader1.panix.com>
In-Reply-To <jvbdoj$rat$1@reader1.panix.com>
Content-Type text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding 7bit
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.2830.1343831530.4697.python-list@python.org> (permalink)
Lines 16
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1343831530 news.xs4all.nl 6913 [2001:888:2000:d::a6]:52355
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:26362

Show key headers only | View raw


>>> things get more tricky, because I can't use queues and pipes to
>>> communicate with a running process that it's noit my child, correct?
>>>
>> Yes, I think that is correct.
> I don't understand why detaching a child process on Linux/Unix would
> make IPC stop working.  Can somebody explain?
>
It is implemented with shared memory. I think (although I'm not 100% 
sure) that shared memory is created *and freed up* (shm_unlink() system 
call) by the parent process. It makes sense, because the child processes 
will surely die with the parent. If you detach a child process, then it 
won't be killed with its original parent. But the shared memory will be 
freed by the original parent process anyway. I suspect that the child 
that has mapped that shared memory segment will try to access a freed up 
resource, do a segfault or something similar.

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Re: Pass data to a subprocess Laszlo Nagy <gandalf@shopzeus.com> - 2012-08-01 10:19 +0200
  Re: Pass data to a subprocess Roy Smith <roy@panix.com> - 2012-08-01 06:59 -0400
    Re: Pass data to a subprocess Laszlo Nagy <gandalf@shopzeus.com> - 2012-08-01 13:07 +0200
    Re: Pass data to a subprocess Laszlo Nagy <gandalf@shopzeus.com> - 2012-08-01 13:26 +0200
    Re: Pass data to a subprocess andrea crotti <andrea.crotti.0@gmail.com> - 2012-08-01 14:25 +0100
    Re: Pass data to a subprocess Roy Smith <roy@panix.com> - 2012-08-01 15:07 -0400
  Re: Pass data to a subprocess Grant Edwards <invalid@invalid.invalid> - 2012-08-01 14:16 +0000
    Re: Pass data to a subprocess Laszlo Nagy <gandalf@shopzeus.com> - 2012-08-01 16:32 +0200
      Re: Pass data to a subprocess Grant Edwards <invalid@invalid.invalid> - 2012-08-01 19:48 +0000
        Re: Pass data to a subprocess Laszlo Nagy <gandalf@shopzeus.com> - 2012-08-02 08:10 +0200
          Re: Pass data to a subprocess Grant Edwards <invalid@invalid.invalid> - 2012-08-02 14:29 +0000
        Re: Pass data to a subprocess Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2012-08-02 13:21 -0400
    Re: Pass data to a subprocess Laszlo Nagy <gandalf@shopzeus.com> - 2012-08-01 16:42 +0200
    Re: Pass data to a subprocess andrea crotti <andrea.crotti.0@gmail.com> - 2012-08-01 16:24 +0100

csiph-web