2

Is there a C API function that will give me the number of CPUs/cores on Mac OS X? Ideally, it should be something that just works across all flavors of OS X. (I really know nothing about Mac OS. This is for a library I'm working on that needs to support OS X.)

1 Answer 1

2

You can use sysctlbyname() with e.g. machdep.cpu.core_count. Do a sysctl -a from the command line to see what might be useful to you.

Not the answer you're looking for? Browse other questions tagged or ask your own question.