[Qt-interest] QThread and multi-core
NARCISO, Rui
RUI.NARCISO at airbus.com
Fri Apr 3 14:19:38 CEST 2009
So if I understand correctly, I should use QThreads instead of python threads and since I use no locking, only signals/slots to communicate with my Gui, I could have as many parallel QThreads as the ones I launch ? Or is the number of QThreads limited somehow?
-----Message d'origine-----
De : qt-interest-bounces at trolltech.com
[mailto:qt-interest-bounces at trolltech.com]De la part de Arnold Krille
Envoyé : vendredi 3 avril 2009 14:15
À : qt-interest at trolltech.com
Objet : Re: [Qt-interest] QThread and multi-core
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
This mail has originated outside your organization, either from an external partner or the Global Internet.
Keep this in mind if you answer this message.
The information in this e-mail is confidential. The contents may not be disclosed or used by anyone other then the addressee. Access to this e-mail by anyone else is unauthorised.
If you are not the intended recipient, please notify Airbus immediately and delete this e-mail.
Airbus cannot accept any responsibility for the accuracy or completeness of this e-mail as it has been sent over public networks. If you have any concerns over the content of this message or its Accuracy or Integrity, please contact Airbus immediately.
All outgoing e-mails from Airbus are checked using regularly updated virus scanning software but you should take whatever measures you deem to be appropriate to ensure that this message and any attachments are virus free.
More information about the Qt-interest-old
mailing list