Virtual CPU or not?

Joseph Koshy joseph.koshy at gmail.com
Sat Dec 18 21:47:15 PST 2004


> I would like to find a method which determines the current number of
> active CPUs.

> Is there a better method than checking that sysctl and divide the
> hw.ncpu by two if set?

You are probably looking for:

   min(number of '0' bits in machdep.hlt_cpus, hw.ncpu)


More information about the freebsd-hackers mailing list