From owner-freebsd-hackers@FreeBSD.ORG Sun Dec 19 05:47:15 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C37CC16A4CE for ; Sun, 19 Dec 2004 05:47:15 +0000 (GMT) Received: from rproxy.gmail.com (rproxy.gmail.com [64.233.170.199]) by mx1.FreeBSD.org (Postfix) with ESMTP id 76D6043D39 for ; Sun, 19 Dec 2004 05:47:15 +0000 (GMT) (envelope-from joseph.koshy@gmail.com) Received: by rproxy.gmail.com with SMTP id y7so124695rne for ; Sat, 18 Dec 2004 21:47:14 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:references; b=mxv8bzJxDHQLnx/LuvyRtRFpHHto877WvufB6iB83uhELWljcvNF74+jPK/FRzL/JvBA67VQZ+gcXTo+gGBo51WxKf+Ck+lPDtoBVQPXvuU1b9/gi9oxk8RD35X79paEVv/J3bHTlzd/6JCCnaiBwGOugeMPLo6qOwANTQ2jacc= Received: by 10.38.11.49 with SMTP id 49mr573172rnk; Sat, 18 Dec 2004 21:47:14 -0800 (PST) Received: by 10.38.209.11 with HTTP; Sat, 18 Dec 2004 21:47:14 -0800 (PST) Message-ID: <84dead7204121821474d86efd4@mail.gmail.com> Date: Sun, 19 Dec 2004 11:17:14 +0530 From: Joseph Koshy To: Attila Nagy In-Reply-To: <41C42915.4080104@fsn.hu> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit References: <41C42915.4080104@fsn.hu> cc: hackers@freebsd.org Subject: Re: Virtual CPU or not? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Joseph Koshy List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Dec 2004 05:47:15 -0000 > 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)