[coyotos-dev] Sleep for interval

Jonathan S. Shapiro shap at eros-os.com
Thu Oct 4 11:18:02 EDT 2007


On Thu, 2007-10-04 at 16:30 +1000, Math Gasm wrote:

>         What storage does the kernel use to hold this resume
>         capability?
> 
> Does it need to be in the kernel? Sleep for interval seems trivial-
> don't
> bother scheduling the process before that time. Sleep until wall time
> is 
> just as easy, a scheduler can keep a linked list of processes to be
> woken up and check it against a time server every now and then.

It needs to be in the kernel for two reasons:

1. The kernel must implement preemption. This means that the kernel
ultimately "owns" the timer interrupt. Because of this, the lowest level
sleep mechanism needs to be in the kernel.

2. The primary scheduler lives in the kernel.

It would be possible to do a user-level timer design where there was
exactly one user-level time agent that could call the kernel. The
problem with this is that the *time agent* now needs to store
capabilities, and it therefore needs to pay for potentially unbounded
storage to hold them.
-- 
Jonathan S. Shapiro
Managing Director
The EROS Group, LLC
www.coyotos.org, www.eros-os.org



More information about the coyotos-dev mailing list