Skip to content

Tracking issue for end-to-end wasi-threads support #10

Closed
@abrown

Description

@abrown

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

  • spec: consider adding wasi_thread_exit for early return from a thread (#7); will require some implementation in wasi-libc and wasmtime
  • spec: fix CI issues (#26)

Toolchains

  • toolchain: allow importing and exporting the same memory in wasm-ld; done in D135898
  • toolchain: allow compiling programs with wasm32-wasi-threads (#326); in progress at #331 and #274
  • toolchain: teach the toolchains to import shared 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 #502

Libraries

  • wasi-libc: only run C constructors once (#339); ready to merge
  • wasi-libc: initial thread-local values must be memcpy-ed to the TLS area; this seems to be handled by some combination of #342 and #343
  • wasi-libc: resolve spinlock questions to merge pthread spinlock support (#324)
  • wasi-libc: create a way to run libc-test tests; in progress at #369
  • wasi-libc: audit for any missing pthreads APIs — the fundamentals are there but we need to determine what functions remain to be enabled

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.

Footnotes

  1. this also likely involves figuring out a better place to create the shared memory initially in Wasmtime (instead of here)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions