delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/03/14/20:27:34

From: "Rafael García" <rafael AT geninfor DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: RE: pause() in idle programas
Date: Tue, 14 Mar 2000 20:24:06 +0100
Organization: Telefonica Transmision de Datos
Lines: 42
Message-ID: <8am3ci$jge$1@diana.bcn.ttd.net>
References: <Pine DOT SUN DOT 3 DOT 91 DOT 1000314094829 DOT 4527F-100000 AT is>
NNTP-Posting-Host: 194.179.101.62
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.00.2014.211
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2014.211
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Eli Zaretskii <eliz AT is DOT elta DOT co DOT il> escribió en el mensaje de noticias
Pine DOT SUN DOT 3 DOT 91 DOT 1000314094829 DOT 4527F-100000 AT is...
>
> On Mon, 13 Mar 2000, Rafael García wrote:
>
> > > >int getoption() {
> > > >   while (!kbhit()) {
> > > >      pause();                  // or delay(50)
> > > >      maintenance();
> > > >      }
> > > >   return getch();
> > > >   }
> > > >

> I think the problem is that your `maintenance' function does something
> CPU-intensive, and that is the cause for what you see.  It's only a
> guess, but since you didn't tell what does `maintenance' do, what else
> can I do?
>
> FWIW, I routinely run Emacs compiled with DJGPP, which does tons of
> complicated stuff inside its idle loop, and I don't see any visible
> effect on other DOS boxes.  In particular, the CPU usage shows
> something like 5% when Emacs is idle.  So I'm curious what could your
> program do to use the CPU so heavily.

I have tried the program in a PentiumII and it works fine: calling pause() y
have more than 500% performance gain in the other proccess. It works better
with my program waiting than with RHIDE waiting (my editor).

But the bad results I told, are with another computer I was using: a 486
laptop with 20Mb. There, I get better performance in the background proccess
when I'm typing to the foreground program :-)
In that machine is better to avoid calling pause().

I'll try to do more tests about this problem...

BTW: is it correct spell 'proccess'?




- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019