[Qt-interest] QThread and multi-core
Arnold Krille
arnold at arnoldarts.de
Fri Apr 3 14:14:57 CEST 2009
On Friday 03 April 2009 13:21:59 NARCISO, Rui wrote:
> Is there any way with python thread or even QThread to force the threads to
> be executed on a CPU which is not the main CPU ?
> I have a quad core and only CPU 1 is being used for the threads I create.
That is natively possible in QThread (unless you use extensive locking and the
gui-thread holds the lock) and should happen automaticly. Actually you don't
want to decide which core your thread runs on, the systems scheduler is better
suited for that.
But its not really possible in python. Because of the big interpreter lock,
you can run different threads in "parallel" but as only one python-instance can
run at a time only one thread running python-code can be active at a time. If
the secondary threads are native QThreads, or do big external things and
release the BIL, they can truly run parallel, otherwise its not possible to
the best of my knowledge.
Have fun,
Arnold
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part.
Url : http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20090403/df1414da/attachment.bin
More information about the Qt-interest-old
mailing list