Mail Archives: djgpp/1998/12/20/04:27:43
On Thu, 17 Dec 1998, Agent Drek 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???
Are you sure you are measuring the CPU load with a right tool? I
compiled a program very similar to yours, and it uses a negligible
amount of CPU time while sleeping. This is because the library
function `sleep' issues the __dpmi_yield call while it waits, which
should release the program's time slice to the OS.
I used the NT-standard Task Manager utility (Press Ctrl-Alt-Del, then
click "Task manager" and choose Processes) to test this.
> while(1)
> {
> /* Poll render queue file */
> _curr = brqe();
> printf("%u\n",_curr);
> sleep (5);
> }
Could it be that the call to `brqe' is the one where all the CPU is
eaten up? (Obviously, I couldn't test that, but I replaced it with a
call to `kbhit'.)
- Raw text -