geraintluff opened issue #10335:
It _looks_ like you can use Wasmtime across threads in a similar way to browsers:
- Create
wasmtime_sharedmemory_t *
- Create one store/instance per thread, with this shared memory as an import
However, some documentation would be extremely reassuring here.
Feature
Documentation and/or example code for how multiple (host) threads can make simultaneous C API calls which affect the same shared memory.
Benefit
Makes it clear that Wasmtime supports this use-case
alexcrichton added the wasmtime:docs label to Issue #10335.
alexcrichton added the wasmtime:c-api label to Issue #10335.
alexcrichton commented on issue #10335:
Yes it's the same model currently, creating/sharing memory and instantiating once-per-thread. There is not currently documentation for this and you're correct it'd be good to add some!
alexcrichton closed issue #10335:
It _looks_ like you can use Wasmtime across threads in a similar way to browsers:
- Create
wasmtime_sharedmemory_t *
- Create one store/instance per thread, with this shared memory as an import
However, some documentation would be extremely reassuring here.
Feature
Documentation and/or example code for how multiple (host) threads can make simultaneous C API calls which affect the same shared memory.
Benefit
Makes it clear that Wasmtime supports this use-case
alexcrichton commented on issue #10335:
I'm going to close this as I think it's answered, but feel free to follow up here if there's anything else.
PPakalns commented on issue #10335:
Looking for the same information. Can not find any practical example that demonstrates this feature for any language.
Last updated: Apr 17 2025 at 10:03 UTC