|
|
About ::
TODO ::
Blog ::
RSS ::
Old blog ::
Projects ::
GIT ::
Gallery ::
Notes
Fri, 19 Jan 2007
Userspce scheduling in M-on-N threading model.
The main purpose of the scheduler as a saparated system is to
hold fairness in spreading CPU clocks between tasks.
Current scheduler just gets next task and gives it its own timeslice (currently equal to 10 milliseconds).
If that task is sleeping in syscall or performing CPU intensive operations,
system will not take that into account.
So tasks which are so called IO-bound,
i.e. waiting in syscall for IO comlpetion (or actually any other sleeping),
are not getting CPU clocks in a fair manner, since theirs timeslices
are spent mostly sleeping. CPU-bound tasks in that model does not fully utilize
CPU too, since part of the time CPU is idle since scheduler put IO-bound
task into execution, and that task is waiting, while it would be possible to
start CPU-bound task.
So, the solution is to provide each task a given timeslice, which
will be decreased when task is actively executed on CPU. If task
puts itself into sleep, its timeslice is reduced according to time,
which was used for active execution. When rescheduling happens
either in syscall time or in a signal, scheduler will select
task with the highest timeslice left. Priority of the task will
correspond to the length of the timeslice each task obtains.
Userspace scheduler also has access to the information, what exactly any task in question
is doing, so if it is known that it is waiting in syscall, it will not be awakened
at all until scheduler receives kevent which given task is waiting for.
/devel/threading :: Link / Comments ()
|