WebAssembly / WebAssembly/binaryen

Allow using Asyncify functions from a shared module

Open
#2,321 8 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
WebAssembly
Stars
8.6k
Forks
885
Avg merge
1d 19h
Merged PRs (30d)
69

Description

As discussed with @kripken earlier today, currently two asyncified WebAssembly modules can't properly interact with each other, because each gets own asyncify_* methods and a global state.

This means that, when module A calls into a module B, and module B schedules an async operation and starts unwinding, the unwinding ends in the module B, and module A thinks that the call has succeeded and finished.

To fix this, we need to allow sharing Asyncify between different modules by providing a single entry point for the implementation that would be imported by all the others.

As a bonus, this would also reduce code duplication between different modules when code splitting and could allow making the Asyncify API implementation more isolated by using a separate memory and not clashing with real linear memory of other modules.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue names no files, tests, or entry points. Start by locating the Asyncify implementation and how separate WebAssembly modules interact; done means shared Asyncify behavior works across module calls without the independent global-state failure described here.

Written by the indexing model from the issue text.

Assessment

Tech stack
wasm
Domain
compilers
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.