Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT sources DOT redhat DOT com Delivered-To: mailing list cygwin AT sources DOT redhat DOT com Date: Sat, 26 May 2001 22:26:56 -0400 From: Christopher Faylor To: cygwin AT cygwin DOT com Subject: Re: The heating on notebook Message-ID: <20010526222656.A10924@redhat.com> Reply-To: cygwin AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com References: <20010526135021 DOT A8207 AT redhat DOT com> <20010526143508 DOT A8585 AT redhat DOT com> <3B106398 DOT 350D1A69 AT ece DOT gatech DOT edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.3.11i In-Reply-To: <3B106398.350D1A69@ece.gatech.edu>; from cwilson@ece.gatech.edu on Sat, May 26, 2001 at 10:16:56PM -0400 On Sat, May 26, 2001 at 10:16:56PM -0400, Charles S. Wilson wrote: >On serious note, it is *possible* that cygwin apps (or any native app, >for that matter) might get stuck in some sort of loop that prevents the >OS from using the HALT instruction to save power (NT/W2K only). Or that >prevents RAIN (a CPUcooler program) to use the HALT instruction (W9x >only). > >This can lead to the appearance that "cygwin makes my computer get hot" >-- when the truth is, you computer is DESIGNED to get hot when the CPU >is at 100% (or high) usage. But you don't ordinarily see that kind of >usage -- let's face it, most of the time a computer is sitting there, >waiting for you to type something. So you THINK your machine is >supposed to run cool, but cygwin makes it get hot -- the truth is that >you computer is usually bored (e.g. using the HALT instruction to save >power), and a poorly written cygwin program doesn't let it get bored... > >I have NO evidence that this is happening, but I thought I'd just throw >some gas on the fire... Fire? Aha! You're part of the conspiracy. But, on an additional serious note. I was thinking about this problem as I was on my way to get a dryer hose today. I yelled "Aha!" and my wife looked at me funny and then sighed. I have no idea why. It occurred to me that if you're sitting in bash, the computer will be polling the console thanks to the need to make the console interruptible. This is the method that Cygwin uses to allow a CTRL-C to work correctly. It's essentially doing this: loop anything in the console? if yes, then break wait did we get a signal? if yes, then set EINTR and break This means that the computer is never really idle. It is constantly switching from kernel mode into user mode -- every 10ms, I believe. I assume that this could run down a laptop's batteries. I guess that this could account for any laptop heat, but it should be no different than running a long excel spreadsheet or something. The "Aha!" was because I think I know how to stop the polling. I could use a method already mentioned here, of closing any handle involved in a read, when a signal comes in. That would "interrupt" the read. I just have to keep track of the handles that are currently being selected or read from, but that is doable. This could speed up cygwin noticeably and maybe keep laptops running cooler. I'll see if I can get something like this into 1.3.3. I'll probably ask for testers before I do this, though. cgf -- Want to unsubscribe from this list? Check out: http://cygwin.com/ml/#unsubscribe-simple