From owner-freebsd-current@FreeBSD.ORG Mon Dec 5 19:32:16 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 F048D16A41F for ; Mon, 5 Dec 2005 19:32:16 +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 CBFB243D69 for ; Mon, 5 Dec 2005 19:32:12 +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 A5C9E1A9DD; Mon, 5 Dec 2005 20:32:10 +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 26943-04; Mon, 5 Dec 2005 20:32:09 +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 4D4C71A6EA; Mon, 5 Dec 2005 20:32:07 +0100 (CET) Message-ID: <439495B1.5060305@shapeshifter.se> Date: Mon, 05 Dec 2005 20:32:01 +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> In-Reply-To: <86mzjflc97.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 Subject: Re: make.conf options you cannot use for building CURRENT 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: Mon, 05 Dec 2005 19:32:17 -0000 Dag-Erling Smørgrav wrote: > Fredrik Lindberg writes: > >>I introduced powerd to pthreads so this is most likely my fault. > > > There is no reason to use threads in powerd. Simply merge the > devd_read() loop into your main loop, using select() with a timeout > instead of usleep(). > Wouldn't that turn in into a polling style again?. The reason to use devd was to obtain a more interrupt driven model instead of the sysctl-polling method originally used. Both metods are supported and the devd method is only used if the devd.pipe is avaiable. Obtaining the AC line state, which occurs at each iteration, requires in the devd case, only reading a variable which is very cheap. However, admittedly, I haven't studied the code for select, and it might be cheap enough. powerd can still run without pthreads (using the sysctl-method), it just needs the proper make magic. Fredrik Lindberg