Page 1 of 1

Scedular

Posted: Mon Apr 10, 2006 5:00 am
by B.E
I've been thinking (I know it is a shock horror) about how to implement my schedular. Here is what i have come up with:

There is a link list of threads that are active. A thread is active when it is not waiting for a message(i.e. keyboard input, network communication, Window messages,etc..). The Timer interrupt cycles though the active threads and gives them a bit of cpu time. If a message is passed to a thread. the thread then is put in the active list ready for excution. if there are no processes in the active list the OS sleeps untill a thread becomes active.

Do you see any problems with this.

Re:Scedular

Posted: Mon Apr 10, 2006 5:24 am
by Brendan
Hi,
B.E wrote:Do you see any problems with this.
No, but...

..why not have several linked lists of threads, one for each priority level?

That way you could have a high priority thread (e.g. the GUI) that always gets CPU time when it needs it and doesn't have to wait for 50 lower priority threads (like defrag or your compiler) to finish their time slices.


Cheers,

Brendan