Subject: Re: Sleazy timing code
To: Technolord <l.raiser@deathsdoor.com>
From: Jukka Marin <jmarin@pyy.jmp.fi>
List: port-alpha
Date: 05/30/2000 14:44:27
On Tue, May 30, 2000 at 01:37:50PM +0200, Technolord wrote:
> On Tue, 30 May 2000, Jukka Marin wrote:
> 
> > consumption to a fraction of the normal level.  Wouldn't an idle loop like
> > this keep the CPU fully (well, almost) active all the time, raising the
> > power consumption to normal levels?
> Usually, no. That is, "slowdown" modes usually come in after some time the
> system is unused by the USER. In other words, it counts the time you don't
> move the mouse, touch the keyboard, not how much CPU is idle. I say
> usually, for at least one (crusoe) chip does measure the cpu consumption
> and act consequently. I don't know others. On i386 (and many other
> achitectures) if the cpu is idle, it's actually running an "idle loop"
> anyway (or, if the OS wants, do something like flush caches, zero unused
> memory, so on).

Well, Motorola 68k architecture supports an instruction called STOP which
literally stops the CPU (including internal clocks) _immediately_ to
conserve power.  The CPU is immediately restarted when an interrupt
occurs.  The AmigaOS was using STOP whenever the system was idle.

Similar systems exist on virtually all microcontrollers I have used.

I believe NetBSD and other UN*X like operating systems are using something
like this on i386 because I have heard from people that after replacing
win* with UN*X, their CPU started running a lot cooler.  Obviously, win*
keeps the CPU running some idle loop all the time (polling for keyboard,
perhaps? ;-) while the more advanced OS'es know better.

  -jm