Skip to content

Commit

Permalink
refactor poll_until to only ever call wasm inside a fiber
Browse files Browse the repository at this point in the history
With `wasmtime`'s `async` support enabled, all guest export calls need to happen
in a fiber because the guest may call back to the host, which may try to suspend
the fiber and return control to the top-level async executor.  In fact, even if
the guest doesn't call back to the host, epoch interruption might be enabled, in
which case the code might be instrumented with yield calls that do the same
thing.

In the process of this refactor, I discovered a couple of other issues (e.g. not
removing tasks from the "yielding" set when disposing of them) and fixed those
as well.

Fixes #9.

Signed-off-by: Joel Dice <[email protected]>
  • Loading branch information
dicej committed Feb 18, 2025
1 parent 798b8c9 commit 3f9321a
Show file tree
Hide file tree
Showing 4 changed files with 254 additions and 345 deletions.
Loading

0 comments on commit 3f9321a

Please sign in to comment.