diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2013-05-08 10:47:23 -0400 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2013-05-08 10:47:23 -0400 |
commit | eb5096bfc7945cb30abb35ae2e1320e687966f89 (patch) | |
tree | 99954bf28aab89a8f8af498f55736e680540d032 | |
parent | b08c71af0295fbfc800081af08b9bad80ce20292 (diff) |
use hw.physicalcpu to get a more accurate CPU count on OS X (hw.ncpu includes hyperthreading cpus)
-rw-r--r-- | libs/pbd/cpus.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libs/pbd/cpus.cc b/libs/pbd/cpus.cc index 77b95a455d..48b919cd96 100644 --- a/libs/pbd/cpus.cc +++ b/libs/pbd/cpus.cc @@ -40,7 +40,7 @@ hardware_concurrency() #elif defined(__APPLE__) || defined(__FreeBSD__) int count; size_t size=sizeof(count); - return sysctlbyname("hw.ncpu",&count,&size,NULL,0)?0:count; + return sysctlbyname("hw.physicalcpu",&count,&size,NULL,0)?0:count; #elif defined(HAVE_UNISTD) && defined(_SC_NPROCESSORS_ONLN) int const count=sysconf(_SC_NPROCESSORS_ONLN); return (count>0)?count:0; |