[Qt-interest] QThread and multi-core
Fabio Dago
fabio.dago at sir.to.it
Fri Apr 3 17:41:41 CEST 2009
This is very interesting, but how can I know how many core are there in
the system in which my applcication runs?
I don't think Qt helps in this case. Is there any other library that
allow to know this and other hardware informations?
Excuse me for the OT...
Thanks!
Fabio.
Paul Floyd ha scritto:
> Quoting "NARCISO, Rui" <RUI.NARCISO at airbus.com>:
>
>
>> 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?
>>
>
> Hi
>
> You need to dimension the number of threads that you create depending on the
> workload, throughput and the number of CPUs available. On UNIX, for each pthread
> that you create (and QThread uses pthreads for the underlying implementation)
> then, from the manpage
>
> attribute. By default, the stack size is 1 megabyte for 32-
> bit processes and 2 megabyte for 64-bit processes (see
> pthread_attr_setstacksize(3C)). If the default is used for
>
> This means that on a 32bit system, you'll have a hard limit of a few thousand
> threads (unless you reduce the default stacksize). However, creating thousands
> of threads would be a very bad idea.
>
> Your aim should be to keep your CPU utilization as high as possible without
> having threads waiting for the CPU. A simple rule of thumb is one thread per
> core (perhaps less one for the GUI, perhaps more if the threads spend a lot of
> time waiting for IO).
>
> A+
> Paul
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest
>
> ------------------------------------------------------------------------
>
>
> Nessun virus nel messaggio in arrivo.
> Controllato da AVG - www.avg.com
> Versione: 8.5.283 / Database dei virus: 270.11.39/2038 - Data di rilascio: 04/02/09 19:07:00
>
>
More information about the Qt-interest-old
mailing list