From owner-freebsd-arch Wed Sep 4 22:40:22 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 A5EBF37B401 for ; Wed, 4 Sep 2002 22:40:14 -0700 (PDT) Received: from rwcrmhc51.attbi.com (rwcrmhc51.attbi.com [204.127.198.38]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3A55343E4A for ; Wed, 4 Sep 2002 22:40:14 -0700 (PDT) (envelope-from julian@elischer.org) Received: from InterJet.elischer.org ([12.232.206.8]) by rwcrmhc51.attbi.com (InterMail vM.4.01.03.27 201-229-121-127-20010626) with ESMTP id <20020905054010.RRAQ1399.rwcrmhc51.attbi.com@InterJet.elischer.org>; Thu, 5 Sep 2002 05:40:10 +0000 Received: from localhost (localhost.elischer.org [127.0.0.1]) by InterJet.elischer.org (8.9.1a/8.9.1) with ESMTP id WAA34525; Wed, 4 Sep 2002 22:35:39 -0700 (PDT) Date: Wed, 4 Sep 2002 22:35:38 -0700 (PDT) From: Julian Elischer To: Giorgos Keramidas Cc: Bruce Evans , arch@FreeBSD.ORG Subject: Re: Process/thread states. In-Reply-To: <20020905042733.GE8069@hades.hell.gr> Message-ID: 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 Thu, 5 Sep 2002, Giorgos Keramidas wrote: > 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. Are you saying the macros are good or bad? > > - Giorgos > To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message