Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 4 Sep 2002 10:00:45 -0700
From:      "Sam Leffler" <sam@errno.com>
To:        "Julian Elischer" <julian@elischer.org>, "Bruce Evans" <bde@zeta.org.au>
Cc:        "John Baldwin" <jhb@FreeBSD.ORG>, <arch@FreeBSD.ORG>, "Alfred Perlstein" <bright@mu.org>
Subject:   Re: Process/thread states.
Message-ID:  <03eb01c25434$9e6113f0$52557f42@errno.com>
References:  <Pine.BSF.4.21.0209040918120.31339-100000@InterJet.elischer.org>

next in thread | previous in thread | raw e-mail | index | archive | help
> On Wed, 4 Sep 2002, Bruce Evans wrote:
>
> >
> > 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 reason I consider using Macros to test and set these states is that
> several people suggested it as a way to abstract away the possible
> complications of the states. I'm kind of curious that almost no-one
> seems to have comments on this consider it's what I would consider to be
> prime arguing material.
>
> apparently no-one cares any more..
>

I care and I gave you my (few) comments.  I consider this sort of thing to
be an issue for the person writing the code.  If you have resposibility for
this work and commit privileges then people should respect that you'll do
the right thing.

There is a fine line between improving the status quo and obscuring what's
going on.  Bugs in macros can be extremely difficult to debug because they
hide what's really happening.  On the other hand they can make code more
understandable to the first time reader and insure consistency.  As I said
above, I think this is really something you need to leave to the judgement
of the person writing the code.  It's easier to go from macros back to
straight code than vice versa.  If Julian's willing to do the work to
"abstract things" then if the result is too obscure then it's not a big deal
to switch back.

    Sam


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?03eb01c25434$9e6113f0$52557f42>