Date: Thu, 15 Nov 2001 11:28:56 -0800 (PST) From: John Baldwin <jhb@FreeBSD.org> To: Dag-Erling Smorgrav <des@ofug.org> Cc: freebsd-arch@FreeBSD.ORG, Peter Wemm <peter@wemm.org>, Bruce Evans <bde@zeta.org.au>, Greg Lehey <grog@FreeBSD.ORG>, Alfred Perlstein <bright@mu.org>, Matthew Dillon <dillon@apollo.backplane.com>, Robert Watson <rwatson@FreeBSD.ORG> Subject: Re: cur{thread/proc}, or not. Message-ID: <XFMail.011115112856.jhb@FreeBSD.org> In-Reply-To: <xzpg07f6dje.fsf@flood.ping.uio.no>
next in thread | previous in thread | raw e-mail | index | archive | help
On 15-Nov-01 Dag-Erling Smorgrav wrote: > Robert Watson <rwatson@FreeBSD.ORG> 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 <jhb@FreeBSD.org> <>< 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?XFMail.011115112856.jhb>