TIP: Click on subject to list as thread! ANSI
echo: muffin
to: Bob Jones
from: Wes Garland
date: 2003-06-29 11:22:18
subject: Keyboard Polling...

BJ> Looks like the BBS is using about half the cpu time 
 BJ> on this system when max is running in console mode. 
 
You're right that this has to do with the way the keyboard is being polled:
scott does this *often*; I don't know why he didn't hook a keyboard
interrupt vector (or, if he did, how missed that usage. ;)
 
It's not that expensive under my system, but this may have to do with how
your version of curses implements non-blocking reads.
 
One way to reduce the amount of CPU use is to use a short blocking read
(see the timeout() functionalityin the curses library). Unfortunately, this
has had some other side effects (like a screen running one char behind) due
to (what I think) is a bug in curses. 
 
I'm tempted to implement a separate thread which does some kind of
exponential-backoff poll on the keyboard, and provides the input back to
the kgetch() routines in fos_os2.c(?). 
 
Hmm. This may need some more thought; I'll post back when I have more
ideas. Or if you have some, that'd be cool. :)
 
Wes

--- Maximus/2 3.01
* Origin: COMM Port OS/2 juge.com 204.89.247.1 (281) 980-9671 (1:106/2000)
SEEN-BY: 633/267 270
@PATH: 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™.