Date: Sun, 20 Dec 1998 11:28:24 +0200 (IST) From: Eli Zaretskii X-Sender: eliz AT is To: Richard Sanders cc: djgpp AT delorie DOT com Subject: Re: cpu eater In-Reply-To: <3679b55b.886652@mail.rapidnet.net> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII 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.