From owner-freebsd-smp@FreeBSD.ORG Tue Jun 2 12:43:00 2009 Return-Path: Delivered-To: freebsd-smp@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D108B1065675 for ; Tue, 2 Jun 2009 12:43:00 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id A2F878FC27 for ; Tue, 2 Jun 2009 12:43:00 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id 59FB346B51; Tue, 2 Jun 2009 08:43:00 -0400 (EDT) Received: from jhbbsd.hudson-trading.com (unknown [209.249.190.8]) by bigwig.baldwin.cx (Postfix) with ESMTPA id 4C6A08A02E; Tue, 2 Jun 2009 08:42:59 -0400 (EDT) From: John Baldwin To: freebsd-smp@freebsd.org Date: Tue, 2 Jun 2009 08:39:00 -0400 User-Agent: KMail/1.9.7 References: <9aed80930906010357w2bf642abk50bbadb6cdf34196@mail.gmail.com> <9aed80930906010738q1d92ae0fje1a83143092fc100@mail.gmail.com> In-Reply-To: <9aed80930906010738q1d92ae0fje1a83143092fc100@mail.gmail.com> MIME-Version: 1.0 Content-Disposition: inline Message-Id: <200906020839.00272.jhb@freebsd.org> Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (bigwig.baldwin.cx); Tue, 02 Jun 2009 08:42:59 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.95 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-2.5 required=4.2 tests=AWL,BAYES_00,RDNS_NONE autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bigwig.baldwin.cx Cc: nocturnal Subject: Re: Show which CPU is executing a thread? X-BeenThere: freebsd-smp@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD SMP implementation group List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Jun 2009 12:43:01 -0000 On Monday 01 June 2009 10:38:39 am nocturnal wrote: > I'm more after a programming API for this and when i search the web all i > find is people saying it cannot be done on FreeBSD in userspace, yet. > > Solaris and Linux can do it but FreeBSD doesn't have this in user space. > > Is anyone working on it, what is the status? Will it be part of SMPng? First of all, why do you need to know this? There are APIs to let you bind yourself to specific CPUs, but there is not a convenient way to figure out which CPU you are on. Probably because unless you bind yourself to a specific CPU, the knowledge is quite useless and racy (you can be preempted in userland at any time and be migrated to another CPU unless you have bound yourself to a CPU). If you do bind yourself to a CPU, then you should know which one you are bound to. :) (And you can also query your binding set.) -- John Baldwin