Mail Archives: djgpp-workers/1999/05/23/19:10:16
Hi,
I noticed that a DJGPP program that does select() wastes a lot of
CPU time running under Linux DosEmu. I could trace down the problem
to the following:
select() calls __dpmi_yield() to give up time slices, but
__dpmi_yield() returns immediately with an error. __dpmi_yield() in
turn tries to call a real-mode interrupt though a DPMI interrupt.
Calling the real-mode interrupt directly does seem to work, however,
as shown by the following program which returns an error for
__dpmi_yield() and OK for the direct interrupt call on my system.
#include <stdio.h>
#include <errno.h>
#include <dpmi.h>
int i;
main ()
{
__dpmi_yield ();
printf ("%i\n", errno);
asm ("mov $0x1680, %eax
int $0x2f
movl %eax, _i");
printf ("%i\n", i & 0xff);
}
Now, I don't know if the problem is with DJGPP or another program.
The relevant program versions are Linux 2.2.9, DosEmu 0.98.4, NWDOS
7.0, CWSDPMI 0.90+ (r3), DJGPP 2.02, GCC 2.8.1 -- hope I didn't
forget anything. ;-)
Anyway, it seems it could be fixed in DJGPP by calling the interrupt
directly, if this doesn't have any bad side effects.
But if it should be fixed elsewhere, I'd appreciate any pointers to
the correct place to ask.
PS: I'm not subscribed, so please CC any answers. Thanks.
Frank
--
Frank Heckenbach, frank AT fjf DOT gnu DOT de
http://fjf.gnu.de/
PGP and GPG keys: http://fjf.gnu.de/plan
- Raw text -