From owner-freebsd-current@FreeBSD.ORG Tue Dec 6 13:18:23 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 D40C916A41F; Tue, 6 Dec 2005 13:18:23 +0000 (GMT) (envelope-from fli+freebsd-current@shapeshifter.se) Received: from mx1.h3q.net (manticore.shapeshifter.se [212.37.5.30]) by mx1.FreeBSD.org (Postfix) with ESMTP id E1B7643D46; Tue, 6 Dec 2005 13:18:22 +0000 (GMT) (envelope-from fli+freebsd-current@shapeshifter.se) Received: from localhost (localhost [127.0.0.1]) by mx1.h3q.net (Postfix) with ESMTP id 88FD91A9DD; Tue, 6 Dec 2005 14:18:20 +0100 (CET) Received: from mx1.h3q.net ([127.0.0.1]) by localhost (mx1.h3q.net [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 42814-01; Tue, 6 Dec 2005 14:18:19 +0100 (CET) Received: from [192.168.0.94] (81-234-243-91-o926.tbon.telia.com [81.234.243.91]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.h3q.net (Postfix) with ESMTP id 7A44D1A6EA; Tue, 6 Dec 2005 14:18:19 +0100 (CET) Message-ID: <43958F9A.2000205@shapeshifter.se> Date: Tue, 06 Dec 2005 14:18:18 +0100 From: Fredrik Lindberg User-Agent: Mozilla Thunderbird 1.0.6 (X11/20050928) X-Accept-Language: en-us, en MIME-Version: 1.0 To: =?ISO-8859-1?Q?Dag-Erling_Sm=F8rgrav?= 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> <86slt6lb9s.fsf@xps.des.no> In-Reply-To: <86slt6lb9s.fsf@xps.des.no> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Virus-Scanned: amavisd-new at h3q.net 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 13:18:24 -0000 Dag-Erling Smørgrav wrote: > Fredrik Lindberg writes: > >>Dag-Erling Smørgrav 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. Ignoring the fact that it does work with -O3 (gcc 3.4.4), could you please explain why it has the potential of failing with high optimizations. Fredrik Lindberg