delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/07/02/06:32:56

Date: Thu, 2 Jul 1998 13:32:43 +0300 (IDT)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: "Gerhard W. Gruber" <g DOT gruber AT sis DOT co DOT at>
cc: djgpp AT delorie DOT com
Subject: Re: bash eats cycles
In-Reply-To: <359B4FDB.689047E0@sis.co.at>
Message-ID: <Pine.SUN.3.91.980702132102.17177C-100000@is>
MIME-Version: 1.0

On Thu, 2 Jul 1998, Gerhard W. Gruber wrote:

> Running bash under NT the system becomes considerable slower.

Everything is slower on NT ;-).

> I noticed the same when I let the Norton
> Commander running and I guess that both of them are not aware that they are
> running in "multitasking" (so much for NT and multitasking) and continuosly
> poll the keyboard (or something other).

Please use the system monitor tool to see whether Bash indeed places any 
significant CPU load on the system when it idles.  Please report what did 
you see.

Bash calls the __dpmi_yield function in its idle loop, which is supposed
to yield the rest of its time slice, so Bash at least tries to be a good
citizen in the multi-programming environment (I don't know about NC, and
it should be obvious that any analogy between those two is null and void,
at least theoretically). 

__dpmi_yield will be changed in DJGPP v2.02, since the present version
causes programs which uses it to hang on certain (rare) Windows 95
configurations, after it invokes another DJGPP program.  It might be that
the same problem causes what you see, but since NT's architecture is very
different, it should be investigated. 

In particular, if you do see significant load during Bash idle time, you 
could write a simple test program with the stock and the new versions of 
__dpmi_yield and see the effect of the change, if any.

I attach the new version of __dpmi_yield below.

#include <errno.h>
#include <dpmi.h>

void
__dpmi_yield(void)
{
   __dpmi_regs r;

  r.x.ax = 0x1680;
  r.x.ss = r.x.sp = r.x.flags = 0;
  __dpmi_simulate_real_mode_interrupt (0x2f, &r);
  if (r.h.al == 0x80)
    errno = ENOSYS;
}

- Raw text -


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