www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/12/20/04:28:17

Date: Sun, 20 Dec 1998 11:28:24 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
X-Sender: eliz AT is
To: Richard Sanders <richard AT stardate DOT bc DOT ca>
cc: djgpp AT delorie DOT com
Subject: Re: cpu eater
In-Reply-To: <3679b55b.886652@mail.rapidnet.net>
Message-ID: <Pine.SUN.3.91.981220112800.27996H-100000@is>
MIME-Version: 1.0
Reply-To: djgpp AT delorie DOT com

On Fri, 18 Dec 1998, Richard Sanders wrote:

> >I am wondering why it appears that the sleep function with
> >the code compiled under DJGPP on the NT seems to use 100% of my CPU???
> 
> Perhaps because DJGPP is DOS and DOS is not multitasking sleep just
> wastes time rather than giving the time back to the OS to be used by
> other processes.

The original poster said the program was run on NT.  NT is not DOS,
and it should honor the __dpmi_yield call (unlike plain DOS which
simply ignores it).  DJGPP programs have no way of affecting what the
OS does with the __dpmi_yield call.

As for what `sleep' does in DJGPP, you could just look into the
sources, which are free, instead of posting assumptions based on
guesses.  The fact is, it does NOT just waste the time, it releases
its current time slice to the scheduler while it waits.

- Raw text -


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