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


Groups > comp.lang.python > #26342

Re: Pass data to a subprocess

Date 2012-08-01 12:16 +0200
From Laszlo Nagy <gandalf@shopzeus.com>
Subject Re: Pass data to a subprocess
References (1 earlier) <CAF_E5JY2sEsauXM-teW4hTHePqFCYK6z+9oLMZcjVWFyYs+gKg@mail.gmail.com> <5017EFB0.6080608@shopzeus.com> <CAF_E5JaEHxsjKoHRhZLzh+YdPU8UqKHae9efCsP7zEvm_37+2w@mail.gmail.com> <5018E687.9000105@shopzeus.com> <CAF_E5Jb83D6Uk-HG0sq5urTfxh6z9_fw+RR2ZEmesWTjEFR4-A@mail.gmail.com>
Newsgroups comp.lang.python
Message-ID <mailman.2813.1343816220.4697.python-list@python.org> (permalink)

Show all headers | View raw


>
> Thanks, there is another thing which is able to interact with running
> processes in theory:
> https://github.com/lmacken/pyrasite
>
> I don't know though if it's a good idea to use a similar approach for
> production code, as far as I understood it uses gdb..  In theory
> though I could be able to set up every subprocess with all the data
> they need, so I might not even need to share data between them.
>
> Anyway now I had another idea to avoid to be able to stop the main
> process without killing the subprocesses, using multiple forks.  Does
> the following makes sense?  I don't really need these subprocesses to
> be daemons since they should quit when done, but is there anything
> that can go wrong with this approach?
On thing is sure: os.fork() doesn't work under Microsoft Windows. Under 
Unix, I'm not sure if os.fork() can be mixed with 
multiprocessing.Process.start(). I could not find official documentation 
on that.  This must be tested on your actual platform. And don't forget 
to use Queue.get() in your test. :-)

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


Thread

Re: Pass data to a subprocess Laszlo Nagy <gandalf@shopzeus.com> - 2012-08-01 12:16 +0200

csiph-web