Date: Mon, 24 May 1999 01:09:01 +0200 From: Frank Heckenbach Message-Id: <5A36B5C3.19990524010901.FOO-2F3A.frank@goedel.fjf.gnu.de> X-Mailer: smtphack 0.3.4 by Jan Andres To: djgpp-workers AT delorie DOT com Subject: __dpmi_yield() Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=iso-8859-1 Reply-To: djgpp-workers AT delorie DOT com 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 #include #include 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