[prev in list] [next in list] [prev in thread] [next in thread]
List: pykde
Subject: Re: [PyQt] Is QThread a (multi)process or a thread?
From: Kyle Altendorf <sda () fstab ! net>
Date: 2016-11-21 22:46:08
Message-ID: ef37632f86b8b9f74ffdcd446ad3c5ea () eumx ! net
[Download RAW message or body]
On 2016-11-21 15:58, Sampsa Riikonen wrote:
> I am launching two subclassed QThreads.
My understanding is that subclassing QThread is rarely the correct thing
to do. Is there something wrong with the stock implementation of a
QThread that you need to override? Rather, you are supposed to create a
stock QThread and also some other QObject-inheriting class with your
logic that you then move to the QThread. This let's that QObject run
via the other thread's event loop.
But like Phil pointed out, multithreading doesn't increase your
available CPU time due to the Python GIL. It's only helpful for I/O
bound tasks and even then the Python community, in my experience,
prefers solutions other than threads (async/twisted/...).
Cheers,
-kyle
_______________________________________________
PyQt mailing list PyQt@riverbankcomputing.com
https://www.riverbankcomputing.com/mailman/listinfo/pyqt
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic