From owner-freebsd-arch Wed Sep 4 10: 0:58 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 6E56037B400; Wed, 4 Sep 2002 10:00:52 -0700 (PDT) Received: from ebb.errno.com (ebb.errno.com [66.127.85.87]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0128D43E42; Wed, 4 Sep 2002 10:00:52 -0700 (PDT) (envelope-from sam@errno.com) Received: from melange (melange.errno.com [66.127.85.82]) (authenticated bits=0) by ebb.errno.com (8.12.5/8.12.1) with ESMTP id g84H0jlJ041936 (version=TLSv1/SSLv3 cipher=RC4-MD5 bits=128 verify=NO); Wed, 4 Sep 2002 10:00:47 -0700 (PDT)?g (envelope-from sam@errno.com)œ X-Authentication-Warning: ebb.errno.com: Host melange.errno.com [66.127.85.82] claimed to be melange Message-ID: <03eb01c25434$9e6113f0$52557f42@errno.com> From: "Sam Leffler" To: "Julian Elischer" , "Bruce Evans" Cc: "John Baldwin" , , "Alfred Perlstein" References: Subject: Re: Process/thread states. Date: Wed, 4 Sep 2002 10:00:45 -0700 Organization: Errno Consulting MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.50.4807.1700 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4807.1700 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 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