www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/05/16/07:18:38

From: Endlisnis <s257m AT unb DOT ca>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Can I send "IDLE" time messages to the OS?
Date: Sat, 15 May 1999 22:25:26 -0400
Organization: BrunNet
Lines: 29
Message-ID: <373E2C96.22E9BD97@unb.ca>
References: <373db3c5 DOT 26324280 AT news DOT mad DOT ttd DOT net>
NNTP-Posting-Host: ftnts1c20.brunnet.net
Mime-Version: 1.0
X-Mailer: Mozilla 4.51 [en] (Win95; U)
X-Accept-Language: en
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Grzegorz Adam Hankiewicz wrote:

> Hello.
>
> Now, with programs like Rhide running in W9x shows that even when you
> are doing nothing with them all the CPU is used. I would like to know
> if there's a special instruction or command to tell that even though
> the program is running, it doesn't catch CPU resources.

     #include <dpmi.h>
     void __dpmi_yield(void);

    This is Intel specific.  I don't know whether RHIDE uses it (or what
version of it use it), but I know that v1.6 uses 98% of the resources on my
333MHz machine when set in the background.  SetEdit (which Rhide is based off
of) only uses around 0.1% when in the background.  So it must use it.  Under
Linux, reading from stdin when there is nothing to read will switch you out.
There is also a way to use the "select" function to wait for incoming
information.  I suspect that your program will be activated if a key is
pressed even if it is not waiting for stdin.  Select seems fairly portable.

--
     (\/) Endlisnis (\/)
          s257m AT unb DOT ca
          Endlisnis AT HotMail DOT com
          ICQ: 32959047



- Raw text -


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