abrown opened PR #6492 from abrown:fix-6153
to bytecodealliance:main
:
This change relaxes what kinds of modules can be run when wasi-threads is enabled via
--wasi-modules experimental-wasi-threads
. Previously, as reported in #6153, simple modules that made no use of thread spawning or shared memories were preemptively rejected when the wasi-threads context was created. This is too restrictive.Instead, this change does the following:
- it moves the check for whether a module is valid according to the wasi-threads specification to the point a new thread is spawned; this resolves #6153
- as noted in #6153, this change also adds a better error message indicating that wasi-threads expects a shared memory import
- the way this is implemented also improves the module instantiation: by constructing an
InstancePre
once when theWasiThreadsCtx
is built, we might shave off a bit of time from the "spawn a thread" call; this supercedes a similar effort in #5741<!--
Please make sure you include the following information:
If this work has been discussed elsewhere, please include a link to that
conversation. If it was discussed in an issue, just mention "issue #...".Explain why this change is needed. If the details are in an issue already,
this can be brief.Our development process is documented in the Wasmtime book:
https://docs.wasmtime.dev/contributing-development-process.htmlPlease ensure all communication follows the code of conduct:
https://github.com/bytecodealliance/wasmtime/blob/main/CODE_OF_CONDUCT.md
-->
abrown requested alexcrichton for a review on PR #6492.
abrown requested wasmtime-core-reviewers for a review on PR #6492.
alexcrichton submitted PR review.
alexcrichton merged PR #6492.
Last updated: Dec 23 2024 at 12:05 UTC