From owner-freebsd-arch Thu Nov 15 11:29:12 2001 Delivered-To: freebsd-arch@freebsd.org Received: from mail11.speakeasy.net (mail11.speakeasy.net [216.254.0.211]) by hub.freebsd.org (Postfix) with ESMTP id 5FB3D37B442 for ; Thu, 15 Nov 2001 11:28:57 -0800 (PST) Received: (qmail 69254 invoked from network); 15 Nov 2001 19:28:56 -0000 Received: from unknown (HELO laptop.baldwin.cx) ([64.81.54.73]) (envelope-sender ) by mail11.speakeasy.net (qmail-ldap-1.03) with SMTP for ; 15 Nov 2001 19:28:56 -0000 Message-ID: X-Mailer: XFMail 1.4.0 on FreeBSD X-Priority: 3 (Normal) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit MIME-Version: 1.0 In-Reply-To: Date: Thu, 15 Nov 2001 11:28:56 -0800 (PST) From: John Baldwin To: Dag-Erling Smorgrav Subject: Re: cur{thread/proc}, or not. Cc: freebsd-arch@FreeBSD.ORG, Peter Wemm , Bruce Evans , Greg Lehey , Alfred Perlstein , Matthew Dillon , Robert Watson Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On 15-Nov-01 Dag-Erling Smorgrav wrote: > Robert Watson writes: >> The implicit question behind that, though, is: are there places in the >> kernel that will always be locked into using curproc/curthread, simply due >> to the structure and behavior of the kernel environment. > > There's a number of cases here: > > 1) the thread in question is curthread, and it is locked. > 2) the thread may be any thread, but it is locked. > 3) the thread may be any thread, and is not locked. > > (am I correct in assuming that curthread is *always* locked in code > called from syscalls?) Err, no. curthread doesn't even have a lock. Look at sys/proc.h. There are some fields we don't use any locks on, because we assume that only curthread messes with its own copy, or some such. -- John Baldwin <>< http://www.FreeBSD.org/~jhb/ "Power Users Use the Power to Serve!" - http://www.FreeBSD.org/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message