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


Groups > comp.lang.python > #26381

Re: Pass data to a subprocess

Path csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!ecngs!feeder2.ecngs.de!newsfeed.freenet.ag!news2.euro.net!newsfeed.xs4all.nl!newsfeed6.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.027
X-Spam-Evidence '*H*': 0.95; '*S*': 0.00; 'removes': 0.05; 'exit': 0.07; 'advice.': 0.09; 'closed.': 0.09; 'specified,': 0.09; 'distinct': 0.16; 'unmapped': 0.16; 'windows?': 0.16; 'handles': 0.18; 'systems.': 0.18; 'memory': 0.18; 'new,': 0.22; 'work.': 0.23; 'to:2**1': 0.23; 'header:In-Reply-To:1': 0.25; 'header:User- Agent:1': 0.26; 'guess': 0.27; 'possibly': 0.27; 'object,': 0.27; "doesn't": 0.28; '(unless': 0.29; 'parent': 0.29; "they'll": 0.29; 'objects': 0.29; 'maybe': 0.29; '(and': 0.32; 'file': 0.32; 'to:no real name:2**1': 0.32; 'subject:data': 0.33; 'to:addr:python- list': 0.33; 'exist': 0.35; 'fail': 0.35; 'process,': 0.35; 'open': 0.35; 'continue': 0.35; 'but': 0.36; 'wanted': 0.36; 'child': 0.36; 'should': 0.36; 'bad': 0.37; 'itself': 0.37; 'two': 0.37; 'communicate': 0.37; 'subject:: ': 0.38; 'object': 0.38; 'talk': 0.38; 'page': 0.38; 'system.': 0.39; 'to:addr:python.org': 0.39; 'received:192': 0.39; 'received:192.168': 0.40; 'stand': 0.61; 'kind': 0.61; 'other.': 0.64; 'region.': 0.65; 'dear': 0.66; 'received:204': 0.72; 'andrea': 0.84; 'processes,': 0.93
Date Thu, 02 Aug 2012 08:10:59 +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, andrea.crotti.0@gmail.com
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> <mailman.2830.1343831530.4697.python-list@python.org> <jvc160$a1b$1@reader1.panix.com>
In-Reply-To <jvc160$a1b$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.2853.1343887874.4697.python-list@python.org> (permalink)
Lines 27
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1343887874 news.xs4all.nl 6878 [2001:888:2000:d::a6]:47732
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:26381

Show key headers only | View raw


> I still don't get it.  shm_unlink() works the same way unlink() does.
> The resource itself doesn't cease to exist until all open file handles
> are closed. From the shm_unlink() man page on Linux:
>
>         The operation of shm_unlink() is analogous to unlink(2): it
>         removes a shared memory object name, and, once all processes
>         have unmapped the object, de-allocates and destroys the
>         contents of the associated memory region. After a successful
>         shm_unlink(), attempts to shm_open() an object with the same
>         name will fail (unless O_CREAT was specified, in which case a
>         new, distinct object is created).
>         
> Even if the parent calls shm_unlink(), the shared-memory resource will
> continue to exist (and be usable) until all processes that are holding
> open file handles unmap/close them.  So not only will detached
> children not crash, they'll still be able to use the shared memory
> objects to talk to each other.
>         
I stand corrected. It should still be examined, what kind shared memory 
is used under non-linux systems. System V on AIX? And what about 
Windows? So maybe the general answer is still no. But I guess that the 
OP wanted this to work on a specific system.

Dear Andrea Crotti! Please try to detach two child processes, exit from 
the main process, and communicate over a multiprocessing queue. It will 
possibly work. Sorry for my bad advice.

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