dlbuunk/vidad — Issue #12: Better scheduler
Author: dlbuunk
Created: 2012-01-06 14:09:27+00:00
State: open

The current scheduler is working. But that is all there is to say about.

Goals for the new scheduler:
==> As in the current system: living, alarming, sleeping and dead threads.
==> There should be several priorities, think 16-128 different ones.
==> As in the current system, there is one thread with 0 priority, the system_idle thread.
==> Having 2 high priority tasks should not prevent low priority threads from running.
==> The number of low-priority threads shouldn't have much influence on the relative amount of time high priority threads get.
==> Threads with really low priority should only be run when nothing else is to be done.
==> Sleeping and immediately waking a thread should not have a _positive_ influence on the time it takes before it is run.

==> The scheduler should provide two functions, one that triggers a scheduling event, and one that is called with a frequency of 0x100 Hz. Such a timer event should NOT cause another thread to be scheduled.
==> The scheduler is provided with a thread_switch() function, and pointers to Thread-objects. (See thread.hxx)

==> Optional: The scheduler should allow multiple cores. Note that this needs a few locks to be created first.