[coyotos-dev] Sleep for interval

Jonathan S. Shapiro shap at eros-os.com
Thu Oct 4 15:26:14 EDT 2007


On Fri, 2007-10-05 at 01:50 +1000, William Leslie wrote:

>         Having two parties attempt to handle an interrupt independent
>         of each
>         other is just begging for problems.
> 
> You could have the kernel hand off control to the scheduler after the
> interrupt, and if a task was supposed to be given control at this
> critical
> time, it will be next on the list.

Yes you could. That amounts to virtualizing the interval timer
interrupt, which is certainly possible.

But your original note implied something quite different: moving the
entire scheduler into user land. This can also be done. Instead of
viewing the interval timer as a reason to pick the next process from the
ready queue, you view it as forcing a directed context switch into the
(user level) scheduler. The user level scheduler in turn invokes the
process that should run, "donating" it the remainder of the scheduler's
slice after reprogramming the slice timeout appropriately.

>  It seems like the important thing with 
> preemption here is that a task is forward enough in the list to
> receive
> control in a timely manner, which is part of the process of ordering
> the
> list.

That is certainly true, but the issue in this case is a little more
subtle: we are trying to decide whether it is better to implement the
list in user mode or in kernel mode.

-- 
Jonathan S. Shapiro
Managing Director
The EROS Group, LLC
www.coyotos.org, www.eros-os.org



More information about the coyotos-dev mailing list