From owner-freebsd-arch Wed Sep 4 2:54:38 2002 Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3E1F637B400; Wed, 4 Sep 2002 02:54:36 -0700 (PDT) Received: from mailman.zeta.org.au (mailman.zeta.org.au [203.26.10.16]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1F89643E65; Wed, 4 Sep 2002 02:54:35 -0700 (PDT) (envelope-from bde@zeta.org.au) Received: from bde.zeta.org.au (bde.zeta.org.au [203.2.228.102]) by mailman.zeta.org.au (8.9.3/8.8.7) with ESMTP id JAA14464; Wed, 4 Sep 2002 09:54:28 GMT Date: Wed, 4 Sep 2002 20:01:50 +1000 (EST) From: Bruce Evans X-X-Sender: bde@gamplex.bde.org To: Julian Elischer Cc: John Baldwin , , Alfred Perlstein Subject: Re: Process/thread states. In-Reply-To: Message-ID: <20020904194643.H914-100000@gamplex.bde.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG 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