Closed pchickey closed 1 year ago
Having absolute
be a dynamic flag comes from CloudABI, which comes from POSIX clock_nanosleep
which has a dynamic TIMER_ABSTIME
flag. Could we guess that most users using clock_nanosleep
and/or calling the WASI API directly are using a constant value for the TIMER_ABSTIME
/CLOCK_ABSTIME
flag?
Yes, I think we should expect that its easy for anyone using the WASI interface directly to handle this change, and for libc to dispatch based on the flag bit is reasonable.
I agree.
Presently, in the monotonic clock interface, duration is conflated with a timestamp, with a boolean in the
subscribe
function indicating whether the instant actually represents a duration.I believe we should distinguish between these in the type system, and rather than use a boolean, expose two different subscribe functions, as shown below.
One advantage of this is that other WASI libraries can then
use wasi:clocks/monotonic-clock.{duration};
as a standard representation of duration. For instance, right now wasi-http uses a u32 to represent at timeout in milliseconds. It would be nice to point to one single duration type and say to always use that one unless the problem domain insists otherwise.