delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/11/12/07:13:37

Date: Wed, 12 Nov 1997 14:12:29 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: Michael Mauch <michael DOT mauch AT gmx DOT de>
cc: djgpp AT delorie DOT com
Subject: Re: RHIDE -- author(s) please read this
In-Reply-To: <3469d3af.4126448@news.uni-duisburg.de>
Message-ID: <Pine.SUN.3.91.971112141210.20379N-100000@is>
MIME-Version: 1.0

On Wed, 12 Nov 1997, Michael Mauch wrote:

> DJGPP's kbhit() looks just at the keyboard buffer variables in DOS
> memory - that's a fast method, but it doesn't allow multitaskers to
> recognize that a program polls the keyboard most of its time.

IMHO, a better way is to use the `select' library function.  It is
portable to Linux (and Unix in general) and calls `__dpmi_yield'
internally while it waits.  It also has a time-out option.  Check it
out in the library reference.

> > And a last note: Have you ever tried, that the __dpmi_yield()
> > has any effect? When I remember correct, I tried it already several
> > times and couldn't see any effect.
> 
> Maybe you can check again with the following little test program(s).

AFAIK, the effect of `__dpmi_yield' depends on the DPMI host and on
the details of how the scheduler works and which parameters did you
set e.g. in the Property Sheet of the DOS box on Windows 95.  Some
DPMI 0.9 hosts don't do anything with that call.

- Raw text -


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