Skip to main content
GameDev.net gamedev.net
🔒 Locked

Detecting how many cores a system has

Started by DividedByZero Jun 5, 2010 at 6:01 AM 2 replies 900+ views
Original Post
DividedByZero
DividedByZero
Is there a way to detect how many cores a CPU has (in a win32 system)?

Thanks in advance :)
rmed002
rmed002
Not sure if Winapi has something for that, never used it in such way.

GPUID instruction usually tells you everything you need to know about CPU, but its a bit tedious to milk the knowledge with it.

http://linux.die.net/man/1/cpuid


[Edit] Damn clipboard messed up...
Ohforf sake
Ohforf sake
Boost has a fairly portable solution:

boost::thread::hardware_concurrency()

see http://www.boost.org/doc/libs/1_35_0/doc/html/thread/thread_management.html

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.