delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/07/14/11:12:50

Message-ID: <35AB757C.3DDD@teleline.es>
Date: Tue, 14 Jul 1998 17:13:00 +0200
From: Mariano Alvarez Fernández <malfer AT teleline DOT es>
Reply-To: malfer AT teleline DOT es
Organization: teleline.es
MIME-Version: 1.0
To: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
CC: djgpp AT delorie DOT com
Subject: Re: About DJGPP v2.02

Eli Zaretskii wrote:
> 
> This seems like a keyboard polling loop.  Is it?
> 
> If it is, then it is quite normal for interactive programs to spend a
> large portion of their running time in the keyboard loop.  To get
> meaningful results about where such programs spend the rest of their
> time, you need to run the profiled program in a way that doesn't let
> it peek at the keyboard too much, like if you force it to do some long
> computation.
> 

Yes, it is, and when there aren't keys pressed the progam update a
screen clock and start a timer to launch some maintenance functions.
Even when the program are doing long computation it query to allow user
stop. It's difficult to profile my program without scan the keyboard,
but I will try it.

> Btw, while we are at it, several comments about this loop:
> 
>   1) It is better to use functions 0x11 and 0x10 instead of 1 and 0,
>      respectively, since the former functions support the extended
>      101-key keyboards.  (The old 84-key keyboards are almost extinct
>      by now, and if you want to support them as well, there's a
>      function to test for that.)  With functions 0x11 and 0x10 you can
>      support keys like F11, the new editing keys, and some Ctrl- and
>      Alt- key combinations which aren't supported by the old functions
> 
>   2) For your program to be a ``good Windows citizen'', it should call
>      __dpmi_yield library function if the keyboard buffer is empty, to
>      yield the rest of its time slice.

I apreciate very much your advices. 1) it's for historical reasons (the
first version of my program was 6 years ago), but I agree, 84-key
keyboards are extinct now. 2) it's a great advice!!. I had noticed my
program slowdown Windows a lot. I saw in the docs _dpmi_yield calls int
2Fh, function 1680h. Do you know if it works with 16-bit programs too?.

Regards, M.Alvarez.

- Raw text -


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