Is there any detailed document explaining wasmtime-fiber?
Not that I’m aware of. It’s a private dependency of wasmtime - it’s not intended for use by other crates.
What's it used for? If it serves to manage corutines, why not just tokio or async-std?
Tokio and async-std operate on Future
s, which are essentially stackless coroutines. Fibers are stackful, i.e. each one has a dynamically sized stack, which is necessary to represent a Wasm guest's call stack. Future
s are fixed-size state machines and thus not useful for that purpose.
Of course, a fiber can be wrapped up in a Future
(i.e. a Future
can own and defer to a fiber), and that's exactly what Wasmtime does for interop with Tokio.
Do you have any particular questions about wasmtime-fiber you'd like to ask?
Great thanks. I will post further questions after researching source codes.
Last updated: Dec 23 2024 at 12:05 UTC