[PyQt] multiprocessing with QApplication

Luke Campagnola lcampagn at email.unc.edu
Mon Jun 11 18:59:35 BST 2012


Thanks, Kovid!
I had no idea multiprocessing uses fork(); this explains everything. It
also seems there is no way to get rid of the copied QApplication after
forking.
There is a patch to allow forkless-multiprocessing on unix, but I think it
might be for python 3 only.

On Mon, Jun 11, 2012 at 1:15 PM, Kovid Goyal <kovid at kovidgoyal.net> wrote:

> The one really useful thing in the multiprocessing module is the
> Listener and Client classes that allow you to establish easy
> communication between your parent and child process. Though even there,
> the implementation in multiprocessing is not EINTR safe so you have to
> wrap calls to accept(), read(), write() in a wrapper that deals with
> EINTR.
>

I agree with you about the multiprocessing package--I really only use it
for the ease of passing python objects between processes. (I use
multiprocessing.Pipe(), which I believe uses the Listener/Client system you
mentioned). I'll definitely try using this with subprocess instead. Thanks
for the EINTR warning; I'm sure that would have taken another hour or two
for me to work out :)

Luke
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20120611/351570a1/attachment.html>


More information about the PyQt mailing list