[PyQt] QThread, suggestions.

Matt Smith melkor at orangepalantir.org
Thu Jan 29 15:34:06 GMT 2009


It looks like I could just replace the QThread with a
multiprocess.Process except for the fact the QThread is a QObject which
uses signals and slots.  

If I want to use the same techniques I would have to start a Process in
a QThread to get similar behavior; a signal when finished.  I suppose
the performance would be better if approached correctly.


thanks
mbs

On Thu, 2009-01-29 at 04:45 -0800, Brian Kelley wrote:
> If you happen to be using python 2.6, multiprocessing is your friend.
> 
> http://docs.python.org/dev/library/multiprocessing.html
> 
> It is very easy to use and because it runs in a separate process,
> there is no global interpreter lock.  Way, way, way better than
> threading for a lot of cases.  If it crashes, the main program doesn’t
> go down.
> 
> Brian
> 
> 
> On 1/27/09 2:01 PM, "Matt Smith" <melkor at orangepalantir.org> wrote:
> 
>         In java they have the "SwingWorker" class and I thought of a
>         way to
>         implement something similar in python.  Here is the code:
>         
>         http://paste.pocoo.org/show/101578/
>         
>         I use this for starting long running processes.  Here is an
>         example of
>         how I have used it.
>         
>         http://orangepalantir.org/files/threadworker.py
>         
>         I was curious for some input, It seems threads are often
>         abused and I
>         don't want to be doing too much abusing.
>         
>         mbs
>         
>         _______________________________________________
>         PyQt mailing list    PyQt at riverbankcomputing.com
>         http://www.riverbankcomputing.com/mailman/listinfo/pyqt
>         




More information about the PyQt mailing list