Scedular

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
B.E

Scedular

Post 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.
User avatar
Brendan
Member
Member
Posts: 8561
Joined: Sat Jan 15, 2005 12:00 am
Location: At his keyboard!
Contact:

Re:Scedular

Post 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
For all things; perfection is, and will always remain, impossible to achieve in practice. However; by striving for perfection we create things that are as perfect as practically possible. Let the pursuit of perfection be our guide.
Post Reply