[Qt-interest] QThread and multi-core
Paul Floyd
paulf at free.fr
Fri Apr 3 18:59:28 CEST 2009
Quoting Fabio Dago <fabio.dago at sir.to.it>:
> 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...
Hi
This is system dependent. On POSIX systems, you should be able to use
sysconf(_SC_NPROCESSORS_ONLN). I think that this should work for Mac OS X,
Linux, Solaris and FreeBSD. The last time that I needed this for HP-UX, it
wasn't available, and I had to use some other system functions. I don't know
what the equivalent is on Windows.
A+
Paul
More information about the Qt-interest-old
mailing list