[coyotos-dev] Sleep, wakeup, and persistence

Charles Landau clandau at macslab.com
Fri Sep 14 14:19:01 EDT 2007


At 2:03 PM -0400 9/14/07, Jonathan S. Shapiro wrote:
>A process wants to sleep until time X. That is easy if the system keeps
>running until then, but if the system re-starts what happens?
>
>   1. The underlying system may not have a monotonically increasing
>      clock. Many embedded systems do not.

You can store the time base in the checkpoint, and restore it on 
restart. Problem solved.

>To deal with these cases, I believe that the semantics of sleep() must
>be as follows:
>
>   1. It means "wake me up as soon as possible after time X"

By definition, you can't do any better than that.

>   2. The caller needs to be able to specify whether a system
>      restart should terminate the sleep.
>   3. The result needs to indicate whether an intervening restart
>      occurred.

Perhaps it makes more sense to support different types of sleep:
sleep until a given real time (and time zone)
sleep for x seconds from now
sleep for a given amount of system-up time
etc.




More information about the coyotos-dev mailing list