Is there a way to load multiple wasm instances on the same block of memory? #19208
Unanswered
frank-pian
asked this question in
Q&A
Replies: 1 comment 5 replies
-
I've seen some discussions with similar thoughts to mine: pthread and wasm_works, neither of which can satisfy our multi-threaded scenario. |
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have multiple wasm instances working on multiple web works. I want them to share the same Shared Array Buffer memory.
Using the WAT build code someone has implemented similar functionality, like this:
https://developer.mozilla.org/en-US/docs/WebAssembly/Understanding_the_text_format#mutating_tables_and_dynamic_linking
https://blog.scottlogic.com/2019/07/15/multithreaded-webassembly.html
Loading multiple wasm instances in the same linear memory requires rational stack space planning. So when I was looking into the wasm work api, I found some ways to customize the location and size of the stack.
https://github.com/emscripten-core/emscripten/blob/main/system/lib/compiler-rt/stack_limits.S
So is there a way for emscripten to do this?
Beta Was this translation helpful? Give feedback.
All reactions