From owner-freebsd-current@FreeBSD.ORG Tue Dec 6 11:23:40 2005 Return-Path: X-Original-To: current@freebsd.org Delivered-To: freebsd-current@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id EDEC516A41F; Tue, 6 Dec 2005 11:23:40 +0000 (GMT) (envelope-from des@des.no) Received: from tim.des.no (tim.des.no [194.63.250.121]) by mx1.FreeBSD.org (Postfix) with ESMTP id 67E2F43D73; Tue, 6 Dec 2005 11:23:36 +0000 (GMT) (envelope-from des@des.no) Received: from tim.des.no (localhost [127.0.0.1]) by spam.des.no (Postfix) with ESMTP id 3A7A42085; Tue, 6 Dec 2005 12:23:28 +0100 (CET) X-Spam-Tests: AWL,BAYES_00,FORGED_RCVD_HELO X-Spam-Learn: ham X-Spam-Score: -3.3/3.0 X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on tim.des.no Received: from xps.des.no (des.no [80.203.243.180]) by tim.des.no (Postfix) with ESMTP id 254CD2083; Tue, 6 Dec 2005 12:23:28 +0100 (CET) Received: by xps.des.no (Postfix, from userid 1001) id 016DA33C1D; Tue, 6 Dec 2005 12:23:27 +0100 (CET) To: Fredrik Lindberg References: <43938F61.1050202@terranova.net> <4393F60E.2040106@shapeshifter.se> <86mzjflc97.fsf@xps.des.no> <439495B1.5060305@shapeshifter.se> <861x0qmuen.fsf@xps.des.no> <43956ADF.4050504@shapeshifter.se> From: des@des.no (=?iso-8859-1?q?Dag-Erling_Sm=F8rgrav?=) Date: Tue, 06 Dec 2005 12:23:27 +0100 In-Reply-To: <43956ADF.4050504@shapeshifter.se> (Fredrik Lindberg's message of "Tue, 06 Dec 2005 11:41:35 +0100") Message-ID: <86slt6lb9s.fsf@xps.des.no> User-Agent: Gnus/5.110002 (No Gnus v0.2) Emacs/21.3 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Cc: Travis Mikalson , current@freebsd.org, njl@freebsd.org Subject: Re: powerd X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Dec 2005 11:23:41 -0000 Fredrik Lindberg writes: > Dag-Erling Sm=F8rgrav wrote: > > If the devd loop is an *alternative* to the polling loop, there's > > even less reason to use threads. > Yes it's an alternative, reading a variable versus doing a sysctl call > each interation. It seemed like I good idea, when I first wrote this > (almost a year ago), to have a thread providing a cached value of the > AC state. But maybe I was trying to be too smart or something. Yes. Not only is it a bad design idea, but the implementation is wrong, and likely to fail badly when compiled at high optimization levels. Please revert powerd.c to revision 1.13. DES --=20 Dag-Erling Sm=F8rgrav - des@des.no