[PyQt] Usage of threads in PyQt
Pierre Barbier de Reuille
pierre.barbierdereuille at gmail.com
Fri Apr 25 16:10:05 BST 2008
On Fri, Apr 25, 2008 at 3:56 PM, Phil Thompson
<phil at riverbankcomputing.com> wrote:
> On Friday 25 April 2008, Sebastien Geffroy wrote:
> > Hi all,
> > I've read many docs on threads's usage in python and their limited
> > interest because of the global lock who prevents simultaneous access of
> > several threads to the VM.
> > Is the problem similar with the threads implemented in PyQt ?
> As it's Python and the same lock - yes.
That being said, the lock is released as soon as you do a system call.
So even though it is not ideal, it is still quite useful (unless you
do some processor intensive computation). Also, most library written
in another language will take care of releasing the lock as soon as
possible, especially if a function takes time to compute. In the end,
multi threading for the purpose of keeping the GUI alive does work!
The only case not working is multi threading for using two processors
(and then, it will work if you use a lower level language for the
Barbier de Reuille Pierre
More information about the PyQt