Is there an option for wasmtime to enable threads? I tried --enable-threads
but that is not recognized. I've built everything with -pthread
and -target wasm32-wasi-threads
E:\tmp\consolelocal>wasmtime run --allow-precompiled obj\Debug\net8.0\wasi-wasm\native\console.wasm
Error: failed to parse WebAssembly module
Caused by:
Invalid input WebAssembly code at offset 23077: threads must be enabled for shared memories
This is my error
I believe the flag you're looking for is --wasm-features=threads
Thanks yes, that looks like it but
Error: failed to run main module `obj\Debug\net8.0\wasi-wasm\native\console.wasm`
Caused by:
0: failed to instantiate "obj\\Debug\\net8.0\\wasi-wasm\\native\\console.wasm"
1: unknown import: `wasi::thread-spawn` has not been defined
Maybe that is not implemented yet in wasmtime
@Scott Waye you might be interested in this blog post which describes the wasi-threads support in Wasmtime a bit more. Namely the --wasi-modules=experimental-wasi-threads
argument needs to be passed
Thanks, that's great. I see I'm missing some linker flags also to import and export the memory. Will do some more playing. I realize it is all pretty new.
@Scott Waye, the Rust support for wasi-threads is still being worked on but C/C++ should be currently possible. Coincidentally, others have been asking similar questions so I opened up this public thread over in the wasi-threads channel to coordinate progress. Feel free to join in there if you want to contribute.
I responded on the issue you opened, happy to either continue there or here too
Thanks for responding , let's continue on the issue .
Last updated: Nov 22 2024 at 17:03 UTC