Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 5 Sep 2002 07:27:33 +0300
From:      Giorgos Keramidas <keramida@ceid.upatras.gr>
To:        Bruce Evans <bde@zeta.org.au>
Cc:        Julian Elischer <julian@elischer.org>, arch@FreeBSD.ORG
Subject:   Re: Process/thread states.
Message-ID:  <20020905042733.GE8069@hades.hell.gr>
In-Reply-To: <20020904194643.H914-100000@gamplex.bde.org>
References:  <Pine.BSF.4.21.0209032347000.26122-100000@InterJet.elischer.org> <20020904194643.H914-100000@gamplex.bde.org>

next in thread | previous in thread | raw e-mail | index | archive | help
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.

- 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?20020905042733.GE8069>