mirage/mirage-tcpip

Remove dependency on monotonic clock.

Opened this issue · 3 comments

See https://lists.xenproject.org/archives/html/mirageos-devel/2016-06/msg00021.html for details -- timers in arpv4.ml, ndpv6.ml, and window.ml use wall-clock monotonic time and occasionally firing tick thread, but could use sleeping threads instead to avoid needing to reference a clock.

for arp, there is https://github.com/hannesm/arp which is independent of Clock... still uses Time.sleep_ns for its tick thread

I've updated this issue to reflect the MCLOCK/PCLOCK split in mirage-types; the dependencies here are on MCLOCK rather than PCLOCK, which is lighter. We should still evaluate refactoring to remove the dependency entirely IMO.

as far as I'm concerned, we should have support for scheduling reoccuring tasks (Lwt_engine.on_timer comes to mind) in MirageOS. manually writing Lwt.async (fun () ->let rec go () = ... sleep n.. go () in go ()) is barely sustainable (plus the sleep n is wrong, since you want to schedule every n ms rather than 'do something ; sleep n ms ; do it again' (which then includes the execution time of the code run).