WebAssembly / wasi-clocks

Clocks API for WASI
40 stars 14 forks source link

Per-process and per-thread clocks #65

Open Vampeyer opened 6 months ago

Vampeyer commented 6 months ago

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 ?

sunfishcode commented 6 months ago

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.