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


Groups > comp.lang.python > #26381

Re: Pass data to a subprocess

Date 2012-08-02 08:10 +0200
From Laszlo Nagy <gandalf@shopzeus.com>
Subject Re: Pass data to a subprocess
References (3 earlier) <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>
Newsgroups comp.lang.python
Message-ID <mailman.2853.1343887874.4697.python-list@python.org> (permalink)

Show all headers | 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