[GHC] #8594: sysctl name "hw.ncpu" (HW_NCPU) is deprecated in Mac OS X

GHC ghc-devs at haskell.org
Wed Dec 4 05:18:20 UTC 2013


#8594: sysctl name "hw.ncpu" (HW_NCPU) is deprecated in Mac OS X
------------------------------------+---------------------------------
       Reporter:  kseo              |             Owner:  simonmar
           Type:  task              |            Status:  new
       Priority:  normal            |         Milestone:
      Component:  Runtime System    |           Version:  7.6.3
       Keywords:                    |  Operating System:  MacOS X
   Architecture:  Unknown/Multiple  |   Type of failure:  None/Unknown
     Difficulty:  Unknown           |         Test Case:
     Blocked By:                    |          Blocking:
Related Tickets:                    |
------------------------------------+---------------------------------
 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.

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/8594>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list