www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/11/13/05:15:29

Date: Thu, 13 Nov 1997 12:15:17 +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: <346ea9be.11954179@unidui.uni-duisburg.de>
Message-ID: <Pine.SUN.3.91.971113121457.23305K-100000@is>
MIME-Version: 1.0

On Wed, 12 Nov 1997, Michael Mauch wrote:

> > 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.
> 
> Yes, thank you for pointing that out. The only draw-back I see is that
> it doesn't work if stdin is redirected.

Huh?  It does work for me.  Can you give an example where it doesn't?
I used the test program created when you compile `select.c' in the
libc sources with -DTEST.

> Yes, somebody else posted that his mouse becomes bumpy in some cases
> when he calls __dpmi_yield(). So calling it all the time is probably not
> really a Good Idea.

No, I think calling `__dpmi_yield' *is* a good idea, since it is
either ignored (when the environment doesn't support it) or makes
the program multitasking-friendly in those environments which do.  The
bumpy mouse is probably caused by something else, not by
`__dpmi_yield' itself.

> OTOH, what do you think about an environment/_CRT0_FLAG option (like
> LFN/_CRT0_FLAG_NO_LFN) that controls if kbhit() should call
> __dpmi_yield() internally or not?

No, I think `kbhit' should work as advertised: only call the keyboard
BIOS function.  It's the responsibility of the programmer to yield the
time-slice if that's what they want.  Doing so is so easy that I don;t
think it requires a bit in the crt0 flags (which is non-portable
anyway).

- Raw text -


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