Can I somehow share memory between dependency modules? #2363
Answered
by
lum1n0us
NinevskiyK
asked this question in
Q&A
|
I've gone through Multiple Modules As Dependencies page and tried to make my own dependencies, but found that I can't simply pass buffer from a main module to a submodule. In particular, I have this two piece of code: and And it seems that worker only sees zeros instead of the actual data. I've created the buffer with |
Answered by
lum1n0us
Jul 17, 2023
Replies: 1 comment 3 replies
|
Because every instance has its own liner memory in this case, worker can not see the content in main's memory directly. Using |
3 replies
Answer selected by
NinevskiyK
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Because every instance has its own liner memory in this case, worker can not see the content in main's memory directly.
Using
wasm_runtime_module_mallocis one possible way. It needs additional help from host. In that scenario, host will manage the lifecyle ofmas(allocation and release). Host will dispatchmastoworkerand other processores(if exist).