Description
Hi all,
As there was recently not much work on the proposal, I'd like us to define some next steps to move towards finalizing threading support in WebAssembly.
A brief summary of the current state:
- a number of ambiguities around
wasi_thread_spawn
host call was clarified - tests have been added
- tooling support:
- partial implementation of pthread API in WASI libc
- a PR to enable threads in Rust: https://github.com/rust-lang/rust/pull/112922/files
- Runtime support:
- Wasmtime
- WAMR
- ... ?
- Open questions:
- should threads be terminated on exiting from start function: return from
_start
#21 - should the memory be exported from the module: should memory be exported as well? #22
- do we need
wasi_thread_exit()
: Iswasi_thread_exit
needed? #7 - do we need API for querying a max thread count: Query the maximum available parallelism #31
- should the proposal be included in wasi_snapshot_preview1: change module name to wasi_snapshot_preview1 #47
- should threads be terminated on exiting from start function: return from
I think there are two possible ways we can move forward with the proposal:
- we keep the proposal in its current stage (phase 1) and start work on a proposal for adding threading to WebAssembly (possibly as an extension to the threads proposal.
- we continue the work on this proposal - define phase 2 advancement criteria (I think we're close), resolve all the remaining questions, define the release plan.
My personal opinion is that we should progress with wasi-threads
proposal and accept the risk it becomes deprecated in the distant future (if ever) by WebAssembly threads - this approach will enable a number of use cases in short/mid-term that are currently blocked by lack of standardization of threading in the WASI ecosystem. There's already been a lot of discussions on open questions, and it feels like some of them only need a summary and updated documentation before closing, and some of them can be even resolved as follow-ups after this proposal.
I'm looking for others' feedback on that before taking any next steps.
cc @sunfishcode @abrown @sbc100 @AlexEne @yamt