From owner-cvs-all  Wed Jan 10 21:12:55 2001
Delivered-To: cvs-all@freebsd.org
Received: from pcnet1.pcnet.com (pcnet1.pcnet.com [204.213.232.3])
	by hub.freebsd.org (Postfix) with ESMTP
	id D52B237B400; Wed, 10 Jan 2001 21:12:36 -0800 (PST)
Received: (from eischen@localhost)
	by pcnet1.pcnet.com (8.8.7/PCNet) id AAA29176;
	Thu, 11 Jan 2001 00:12:09 -0500 (EST)
Date: Thu, 11 Jan 2001 00:12:07 -0500 (EST)
From: Daniel Eischen <eischen@vigrid.com>
To: "Justin T. Gibbs" <gibbs@scsiguy.com>
Cc: John Baldwin <jhb@FreeBSD.org>,
	=?ISO-8859-1?Q?G=E9rard_Roudier?= <groudier@club-internet.fr>,
	Jake Burkholder <jake@FreeBSD.org>, cvs-committers@FreeBSD.org,
	cvs-all@FreeBSD.org, Bruce Evans <bde@zeta.org.au>
Subject: Re: cvs commit: src/sys/alpha/alpha interrupt.c machdep.c mp_mac 
In-Reply-To: <200101110428.f0B4Rcs23445@aslan.scsiguy.com>
Message-ID: <Pine.SUN.3.91.1010111000241.27724A-100000@pcnet1.pcnet.com>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
Sender: owner-cvs-all@FreeBSD.ORG
Precedence: bulk
X-Loop: FreeBSD.ORG

On Wed, 10 Jan 2001, Justin T. Gibbs wrote:
> >No, shared variables are just variables.  Here is the problem.  There is no
> >'curproc' variable.  There is a gd_curproc member of a struct globaldata, and
> >each CPU has a struct globaldata tied to it.  We can obtain it via
> >PCPU_GET(curproc), or set it via PCPU_SET(curproc, myproc).  Having a 'curproc
> >'
> >"magic" variable that doesn't exist that we assume we can read and write to
> >like any other variable is a lot more hokie than admitting that we are
> >accessing a special variable in a special way.
> 
> Anyone touching these variables had better understand what they are for
> and how they operate.  I think our developers are smart enough to understand
> this without ugly upper-case macros.  Heck "errno" is not spelled
> PTHREAD_GET(errno), or PTHREAD_SET(errno, error) and still people seem
> to be able to write useful threaded apps. 8-)

Uh-oh.  I've just gone through libc (not committed yet) and replaced all 
instances of "errno = x" to _set_errno(x) to deal with threaded apps.  I
didn't realize that it actually worked correctly.

Should I discard these changes, or is _set_errno(x) seen as a better
interface than errno = x?

-- 
Dan Eischen



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe cvs-all" in the body of the message