Mail Archives: djgpp/1999/05/16/07:18:38
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 -