Can SharedMemory be used across multiple modules? Module A exports the memory and same memory is imported into Module B. Is there a sample code for that?
It can, yes. You can follow the example here to instantiate a module with shared memory, and extracting a shared memory is iterating over the imports of one instance. I'm not aware of self-contained examples for this
To create a shared memory, access to engine is required, right? Is there an example to create extern shared memory in Rust?
Sorry there's not a ton of examples for threads right now, you'll need to do most of the learning through exploration of the API documentation. It's not really in a state for ease-of-consumption right now due to the work-in-progress state of things.
Last updated: Dec 23 2024 at 12:05 UTC