[coyotos-dev] Sleep for interval
Charles Landau
clandau at macslab.com
Tue Sep 25 14:43:13 EDT 2007
>In contrast to all other kernel capabilities, which are always
>receiving, the definition of the sleep object is that it will remain in
>a non-receiving state until the invoker's specified interval has run
>out. This has three consequences:
>
> 1. Sleep always happens to the invoker. Process A cannot place process
> B onto a kernel sleep queue.
So the sleep object cannot be accurately proxied, which is
unfortunate. If you later did decide to implement this outside the
kernel, you could not do so compatibly.
>The main question here is: what should be done if a checkpoint/restart
>occurs? It seems to me that there are several cases to consider:
>
> 2. ... all interval sleeps are terminated by
> restart.
>
> In the absence of a free-running time source that survives power
> interruption there is no sensible way to determine how much of an
> interval may have passed, so there is no outcome under which a
> re-issued interval can be sensibly interpreted.
I think not:
At 1:57 PM -0700 9/14/07, Charles Landau wrote:
>Another notion is system-up time. I can say "sleep until the
>system has run for at least 5 seconds". This might be useful for
>timeouts of other programs.
This request might be difficult to fulfill if it is not supported in
the kernel.
I'm suggesting you give the sleeper the choice of (1) waking up after
x seconds of uptime, or (2) waking up after x seconds or restart
whichever occurs first. Note that uptime gets rolled back on a
restart.
More information about the coyotos-dev
mailing list