getting number of processors

  • Thread starter Thread starter zeero
  • Start date Start date
Z

zeero

Hi,
i want to get the number processors in my machine. Plz guide. The code is
running on a core 2 duo machine have 2 processing cores so I expect to get 2
processors.
I'm writing code in native visual c++ 2005.
Regards,

..z
 
i want to get the number processors in my machine. Plz guide. The code is
running on a core 2 duo machine have 2 processing cores so I expect to get 2
processors.

Have you tried the GetSystemInfo API?

Dave
 
No not yet. I was searching the net and I got some information that the
assembly instruction called "cpuid" may help. And there a c/c++ function
available (microsoft specific) called "__cpuid" which is perhaps a wrapper
around this cpuid instruction. I ll look at the getsysteminfo api also.

Thanks,
..z
 
Back
Top