Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 4 Sep 2002 20:01:50 +1000 (EST)
From:      Bruce Evans <bde@zeta.org.au>
To:        Julian Elischer <julian@elischer.org>
Cc:        John Baldwin <jhb@FreeBSD.ORG>, <arch@FreeBSD.ORG>, Alfred Perlstein <bright@mu.org>
Subject:   Re: Process/thread states.
Message-ID:  <20020904194643.H914-100000@gamplex.bde.org>
In-Reply-To: <Pine.BSF.4.21.0209032347000.26122-100000@InterJet.elischer.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, 3 Sep 2002, Julian Elischer wrote:

> On Wed, 4 Sep 2002, Bruce Evans wrote:
>
> > On Tue, 3 Sep 2002, Julian Elischer wrote:
> > [... thread classification macros]
> > Just don't forget to change it back to a simple test once you have debugged
> > and optimized it :-).  One virtue of inline code is that it inhibits expansion
> > of huge macros to huger ones.

> Do you mean edit it again and remove all the macros later?

Yes, if you can get the state checks back to be simple ones (which is a
reasonable goal for both efficiency and simplicity).

> There is a certain readbility that comes with a concise macro name
> that is not present (from the point of view of the lay reader)
> in the more crude direct tests.
>
> 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.

Bruce


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?20020904194643.H914-100000>