Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 19 Dec 2004 11:17:14 +0530
From:      Joseph Koshy <joseph.koshy@gmail.com>
To:        Attila Nagy <bra@fsn.hu>
Cc:        hackers@freebsd.org
Subject:   Re: Virtual CPU or not?
Message-ID:  <84dead7204121821474d86efd4@mail.gmail.com>
In-Reply-To: <41C42915.4080104@fsn.hu>
References:  <41C42915.4080104@fsn.hu>

next in thread | previous in thread | raw e-mail | index | archive | help
> 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)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?84dead7204121821474d86efd4>