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: 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 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: <5017EFB0.6080608@shopzeus.com> In-Reply-To: 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: 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 > 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.