Date: Wed, 4 Sep 2002 22:35:38 -0700 (PDT) From: Julian Elischer <julian@elischer.org> To: Giorgos Keramidas <keramida@ceid.upatras.gr> Cc: Bruce Evans <bde@zeta.org.au>, arch@FreeBSD.ORG Subject: Re: Process/thread states. Message-ID: <Pine.BSF.4.21.0209042235180.34499-100000@InterJet.elischer.org> In-Reply-To: <20020905042733.GE8069@hades.hell.gr>
next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, 5 Sep 2002, Giorgos Keramidas wrote: > On 2002-09-04 20:01 +0000, Bruce Evans wrote: > > On Tue, 3 Sep 2002, Julian Elischer wrote: > > > If (TD_ON_SLEEPQ(td) && TD_IS_RUNNING(td)) > > > is presently expressed as: > > > > > > if ((td->td_wchan != 0) && td->td_state == TDS_RUNNING) > > > > > > I know which of those two I'd rather see if I was a new developer trying > > > to work out what the heck is going on.. > > > > I'd rather see (td->td_state == TDS_RUNNING). Only very lay readers don't > > want to know anything about the details hidden by the macro. > > The mask test is not that bad, when read from someone who has very > small experience with this part of the kernel. Or even, checks like: > > if ((td->td_wchan == 0) && (td->td_state & TDS_RUNNING || > td->td_state & TDS_SUSPENDED)) > > It's not bad to know what is going on `within' the td struct, imho. Are you saying the macros are good or bad? > > - Giorgos > 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?Pine.BSF.4.21.0209042235180.34499-100000>