Mail Archives: djgpp/2000/03/14/07:43:07
On Mon, 13 Mar 2000, Rafael García wrote:
> > >int getoption() {
> > > while (!kbhit()) {
> > > pause(); // or delay(50)
> > > maintenance();
> > > }
> > > return getch();
> > > }
> > >
> > >this must do a better work in distributing CPU power between multiple
> > >programs, but I have found that this makes other proccess to perform much
> > >poorly.
> >
> > Don't use pause(), use __dpmi_yield() instead.
>
> I don't see the difference. Performance is the same, it works much better
> without both.
The function `pause' already calls `__dpmi_yield' internally, so it's
a small wonder that you don't see any difference.
I think the problem is that your `maintenance' function does something
CPU-intensive, and that is the cause for what you see. It's only a
guess, but since you didn't tell what does `maintenance' do, what else
can I do?
FWIW, I routinely run Emacs compiled with DJGPP, which does tons of
complicated stuff inside its idle loop, and I don't see any visible
effect on other DOS boxes. In particular, the CPU usage shows
something like 5% when Emacs is idle. So I'm curious what could your
program do to use the CPU so heavily.
- Raw text -