Several of us (@loganek, @sunfishcode, @sunfishcode, @haraldh) have been working towards implementing all of the pieces to demonstrate an end-to-end wasi-threads example. The current direction is to implement this in Wasmtime, though @loganek has also opened a PR to do so in WAMR (#1638). To that end, this issue is meant to track all of the various parts needed not only to show a proof-of-concept, but to upstream enough code for (fearless) users to try out this new functionality. I do not expect this to be a comprehensive plan, but only to implement what is necessary for the "stage 1" functionality described by @alexcrichton here (i.e., no component model integration).
We can split this into areas and I've made an effort to try to order the tasks within these.
Specification
Toolchains
Libraries
Engines
I'm completely open adding/removing/editing the items above as well as moving this issue somewhere else but I felt it would be helpful to keep track of the state of things.
Several of us (@loganek, @sunfishcode, @sunfishcode, @haraldh) have been working towards implementing all of the pieces to demonstrate an end-to-end
wasi-threadsexample. The current direction is to implement this in Wasmtime, though @loganek has also opened a PR to do so in WAMR (#1638). To that end, this issue is meant to track all of the various parts needed not only to show a proof-of-concept, but to upstream enough code for (fearless) users to try out this new functionality. I do not expect this to be a comprehensive plan, but only to implement what is necessary for the "stage 1" functionality described by @alexcrichton here (i.e., no component model integration).We can split this into areas and I've made an effort to try to order the tasks within these.
Specification
wasi_thread_exitfor early return from a thread (#7); will require some implementation inwasi-libcandwasmtimeToolchains
wasm-ld; done inD135898wasm32-wasi-threads(#326); in progress at#331and #274importshared memories by default; it seems most natural to have both the parent and child threads import a memory versus exporting it 1; under discussion at #502Libraries
memcpy-ed to the TLS area; this seems to be handled by some combination of #342 and#343libc-testtests; in progress at #369Engines
waitandnotify; on Linux, this could usefutexas done here by @haraldh but we need a solution for all OSes (also, is the 32-bit limitation a problem?)validate_atomic_addr;#5063#5239wasi-threads; in progress at #5484I'm completely open adding/removing/editing the items above as well as moving this issue somewhere else but I felt it would be helpful to keep track of the state of things.
Footnotes
this also likely involves figuring out a better place to create the shared memory initially in Wasmtime (instead of here) ↩