The NSProcessInfo
class has two methods named processorCount
and activeProcessorCount
. The documentation is as unhelpful as possible as to what is the different between a processing core and an active processing core. Or, in other words: what counts as an inactive processing core for Cocoa?
Asked
Active
Viewed 2,196 times
6

F'x
- 12,105
- 7
- 71
- 123
1 Answers
4
It may be that OS X can shut down cores when the system is overloaded (to reduce temperature).
On older MacBooks, one core could shut down if the power cord was the only power source (no battery). (I can't find link for that one but I'm pretty sure that was the case for my 2007 white MacBook.)
Also, the hwprefs command line utility can enable/disable processors cores.
Most of the time, you really want the activeProcessorCount
since it's what really represents the state of the machine.
Edit: hwprefs
is gone in Lion, but you can access the same functionality with sysctl -n hw.ncpu

gcamp
- 14,622
- 4
- 54
- 85