wasi-clocks icon indicating copy to clipboard operation
wasi-clocks copied to clipboard

Per-process and per-thread clocks

Open Vampeyer opened this issue 1 year ago • 1 comments

Hello there , Hey I was just wondering ,

Is it still possible for a feature , of one or the other , to build further API's on for Per-process - OR - per-thread clocks ?

  • I just like using nice timing functions for stuff , and I was curious , Thank you !

Vampeyer avatar May 20 '24 04:05 Vampeyer

Per-process is complicated by the fact that WASI doesn't have a concept of a process, and even if we said that a Wasm instance is a "process", many host implementations run multiple Wasm instances in a single host process, so it's not straightforward to use the host process timer to implement a WASI "instance" timer.

Per-thread is complicated by the fact that when WASI supports threads, some implementations are expected to not have a 1-1 correspondence between WASI threads and host threads, so it's again not straightforward to use the host thread timer to implement a WASI thread timer.

sunfishcode avatar May 20 '24 11:05 sunfishcode