Date: Mon, 05 Dec 2005 20:32:01 +0100 From: Fredrik Lindberg <fli+freebsd-current@shapeshifter.se> To: =?ISO-8859-1?Q?Dag-Erling_Sm=F8rgrav?= <des@des.no> Cc: Travis Mikalson <bofh@terranova.net>, current@freebsd.org Subject: Re: make.conf options you cannot use for building CURRENT Message-ID: <439495B1.5060305@shapeshifter.se> In-Reply-To: <86mzjflc97.fsf@xps.des.no> References: <43938F61.1050202@terranova.net> <4393F60E.2040106@shapeshifter.se> <86mzjflc97.fsf@xps.des.no>
next in thread | previous in thread | raw e-mail | index | archive | help
Dag-Erling Smørgrav wrote: > Fredrik Lindberg <fli+freebsd-current@shapeshifter.se> 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?439495B1.5060305>