From owner-freebsd-arch Wed Sep 4 21:27:41 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 7CD0437B400 for ; Wed, 4 Sep 2002 21:27:39 -0700 (PDT) Received: from nic.upatras.gr (nic.upatras.gr [150.140.129.30]) by mx1.FreeBSD.org (Postfix) with SMTP id 0963E43E42 for ; Wed, 4 Sep 2002 21:27:38 -0700 (PDT) (envelope-from keramida@ceid.upatras.gr) Received: (qmail 25096 invoked from network); 5 Sep 2002 04:20:54 -0000 Received: from upnet-dialinpool-23.upatras.gr (HELO hades.hell.gr) (150.140.128.231) by nic.upatras.gr with SMTP; 5 Sep 2002 04:20:54 -0000 Received: from hades.hell.gr (hades [127.0.0.1]) by hades.hell.gr (8.12.6/8.12.6) with ESMTP id g854RYlt011380; Thu, 5 Sep 2002 07:27:34 +0300 (EEST) (envelope-from keramida@ceid.upatras.gr) Received: (from charon@localhost) by hades.hell.gr (8.12.6/8.12.6/Submit) id g854RXS3011379; Thu, 5 Sep 2002 07:27:33 +0300 (EEST) (envelope-from keramida@ceid.upatras.gr) Date: Thu, 5 Sep 2002 07:27:33 +0300 From: Giorgos Keramidas To: Bruce Evans Cc: Julian Elischer , arch@FreeBSD.ORG Subject: Re: Process/thread states. Message-ID: <20020905042733.GE8069@hades.hell.gr> References: <20020904194643.H914-100000@gamplex.bde.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20020904194643.H914-100000@gamplex.bde.org> 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 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