TIP: Click on subject to list as thread! ANSI
echo: linuxhelp
to: Geo
from: Tony Ingenoso
date: 2005-05-09 00:44:42
subject: Re: This is not an Anti-OSS Flame

From: "Tony Ingenoso" 

This is the nature of all (non-MT aware) DOS apps.  When there is nothing
else to do they scan for keystrokes.  The problem is not that the CPU meter
goes to 100%.  The problem would be if it impacts the rest of system
performance when something really is going on elsewhere -- i.e. if its
keyboard polling loop is doing OTHER things that trick the OS's idle
detection logic into thinking the app is really doing something.  When this
happens, the app will be a genuine CPU burner impacting other stuff in the
system.

If it just pegs the meter with nothing else running on the system, then its
actually a normal condition - the scheduler would choose to run the DOS app
rather than its own idle loop.  The DOS app will burn the CPU polling, and
the meter(running at an idle time priority) will naturally be starved and
think the machine is at 100% - which it is, but the CPU is really available
for something else even though it appears to be 100%. If the idle detection
logic works OK, the first time something else shows up in the system, the
DOS app would be knocked back.

There are a few DOS apps out there that are hard to do proper idle
detection on because of the mix of other API calls and activity they mixed
in with their KBD polling.  Not a lot of them, but there are a few.  One of
the Word Perfect releases was a PITA this way as I recall.  DOS app idle
detection is really a bunch of heuristic black magic

"Geo"  wrote in message
news:427ec4ef$1{at}w3.nls.net...
> "Tony Ingenoso"  wrote in message
> news:427eb908$1{at}w3.nls.net...
>
> > Don't laugh, I've seen an editor (one of Borland's first OS/2 apps)
under
> > the OS/2 kernel debugger that allocated and freed a 1 byte segment on
> every
> > keystroke.  Every keystroke was two expensive trips through kernel
memory
> > management.  Programmers do some pretty dumb things...
>
> this I can believe, I remember some borland dos app that used to run NT to
> 100% cpu usage because of it's key poling routine and as a programmer I've
> done some pretty dumb things so I have no problem believing that either.
>
> But there are other issues. Most of the apps that I use don't have a
problem
> with cpu speed being the bottleneck, the times I spend waiting for the app
> are usually when it's talking to the disk or network.
>
> Geo.
>
>

--- BBBS/NT v4.01 Flag-5
* Origin: Barktopia BBS Site http://HarborWebs.com:8081 (1:379/45)
SEEN-BY: 633/267 270 5030/786
@PATH: 379/45 1 106/2000 633/267

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.