Stream: wasmtime

Topic: Preemptive Threading for Wasmtime


view this post on Zulip Jerry Yang (Dec 12 2025 at 06:48):

Hi folks, my friend and I are working on supporting preemptive threading in Wasmtime (i.e., adding the scheduling part to time-slice running fibers and perform runtime-managed context switches, right now, round-robin only). This work is built directly on top of the existing cooperative threading context-switching work last month. Our current prototype is x86_64-only, since the runtime currently has full support only on x86_64.

We have an initial implementation exploring two interrupt mechanisms:

This has been a fun project, but we would like to sanity-check the direction with the Wasmtime team and the broader community:

This work is primarily exploratory and for fun, but we are also hoping to align on whether a proposal is plausible and, if so, to have a concrete target to guide further implementation.

Thanks!

view this post on Zulip Joel Dice (Dec 15 2025 at 14:23):

Sounds like a great project!

Jerry Yang said:

Not that I'm aware of -- at least not for the component model.

A PR to the component-model would probably be a good place for a draft if you've got something concrete to share. If you're still feeling out the design space, an issue on that repo and/or a discussion on Zulip would also be appropriate.

Repository for design and specification of the Component Model - WebAssembly/component-model

view this post on Zulip Joel Dice (Dec 15 2025 at 16:36):

The main question that comes to mind for me is: How might this be implemented in other runtimes which might not have an equivalent to epoch interruption or fuel metering?


Last updated: Jan 10 2026 at 20:04 UTC