Morten Due Jorgensen wrote:

>Given two programs, one running at normal priority, the other at the 
>lowest possible priority (idle priority), the second program will get 
>around 1-2% of the CPU, 

I noticed the same thing under Linux (with rc5des). Idle processes get a
few % cpu time even on perfectly busy systems.

Perhaps the turn-around time of the task switcher could be used to
identify a busy system and yield immediately if neccesary.
I.e. get the Pentium CPU-clock cycle count upon time slice exit (is that
possible?) and next time our program becomes active, compare new value
to old and yield if the turn-around time was more than a few
milliseconds. This would reduce the CPU load of our program to nearly
zero if the system is busy with other tasks.

(This stuff is based on my rather crude understanding of multitasking
environments, please flame politely.. :)

Ciao,
  Alex.

Reply via email to