sysctl name "hw.ncpu" (HW_NCPU) is deprecated in Mac OS X
|Reported by:||kseo||Owned by:||simonmar|
|Operating System:||MacOS X||Architecture:||Unknown/Multiple|
|Type of failure:||None/Unknown||Difficulty:||Unknown|
|Test Case:||Blocked By:|
According to the OS X man page for sysctl(https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man3/sysctlbyname.3.html), HW_NCPU used by the current implementation of getNumberOfProcessors() is deprecated.
Instead, Mac OS X provides the following 4 options:
- hw.physicalcpu: The number of physical processors available in the current power management mode.
- hw.physicalcpu_max: The maximum number of physical processors that could be available this boot.
- hw.logicalcpu: The number of logical processors available in the current power management mode.
- hw.logicalcpu_max: The maximum number of logical processors that could be available this boot.
I am not sure which one fits best to GHC runtime. Any idea? sysconf implementation of getNumberOfProcessors() seems to prefer _SC_NPROCESSORS_ONLN to _SC_NPROCESSORS_CONF when both are defined.