This is the mail archive of the cygwin@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: The heating on notebook


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]