Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!steinmetz!davidsen From: davidsen@steinmetz.steinmetz.UUCP (William E. Davidsen Jr) Newsgroups: comp.emacs Subject: Re: MicroEMACS works but eats CPU on SysV Message-ID: <8007@steinmetz.steinmetz.UUCP> Date: Mon, 30-Nov-87 11:35:47 EST Article-I.D.: steinmet.8007 Posted: Mon Nov 30 11:35:47 1987 Date-Received: Thu, 3-Dec-87 06:10:41 EST References: <1107@sugar.UUCP> <422@cimcor.UUCP> <6295@ncoast.UUCP> Reply-To: davidsen@kbsvax.steinmetz.UUCP (William E. Davidsen Jr) Organization: General Electric CRD, Schenectady, NY Lines: 29 In article <6295@ncoast.UUCP> allbery@ncoast.UUCP (Brandon Allbery) writes: >As quoted from <422@cimcor.UUCP> by mike@cimcor.UUCP (Michael Grenier): >+--------------- >| In article <1107@sugar.UUCP>, karl@sugar.UUCP (Karl Lehenbauer) writes: >| > Anyway, emacs works just fine, but it totally eats CPU time (pretty >| > much all that's available), even when it's just sitting there waiting for > >Don't patch it blindly or you'll lose functionality. The reason it loops >is that System V has a "non-blocking read", which allows the program to >continue if nothing has been typed. At the least, I'd hazard a guess that >it is used to interrupt a refresh when there is pending input. I posted a fix for this the day after 3.9e was released, and someone just posted the fix again. The program sets "polling mode" while updating, and "blocking mode" when reading the keys. The loop was put in because the poll didn't return a character. If you set the "polling mode" flag where the ioctl changes to polling (later in the same routine) it works fine. I reported this in 3.9 but just used 3.8i for that module. After fixing the flag, you can take the while loop out and just read the keyboard with a normal read. I posted the fixes, but not the logic, hope this permanently fixes the problem. -- bill davidsen (wedu@ge-crd.arpa) {uunet | philabs | seismo}!steinmetz!crdos1!davidsen "Stupidity, like virtue, is its own reward" -me