You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'd like to ask some directions in an issue I cannot solve. I have a runtime that runs many modules at the same time in different threads. I initialize the runtime with wasm_runtime_init and register some native modules with wasm_runtime_register_natives.
Then in the threads, I run wasm_runtime_init_thread_env, and load/execute modules separately.
But now we need to run them with two sets of native symbols, so ModuleA needs nativeSymbolsA, and ModuleB needs nativeSymbolsB as native symbols. They both need to run at the same time from the same process, but from different threads. How could I achieve this?
Thank you!
The text was updated successfully, but these errors were encountered:
IIUC, you want to separate those two sets of native symbols right? You can consider wasm_runtime_init, then in one thread's critical section register_natives the first set of symbols, load the first module(unregister the first set of symbols if there are name conflicting or you don't want module B potentially use the first set of native symbols), and in another thread's critical section, register_natives the second set of symbols and load the second module. By critical section I mean you need to use lock or other sync primitives you prefer to make sure the register-load-unregister process happens atomically
Thank you for your awesome work!
I'd like to ask some directions in an issue I cannot solve. I have a runtime that runs many modules at the same time in different threads. I initialize the runtime with
wasm_runtime_init
and register some native modules withwasm_runtime_register_natives
.Then in the threads, I run
wasm_runtime_init_thread_env
, and load/execute modules separately.But now we need to run them with two sets of native symbols, so
ModuleA
needsnativeSymbolsA
, andModuleB
needsnativeSymbolsB
as native symbols. They both need to run at the same time from the same process, but from different threads. How could I achieve this?Thank you!
The text was updated successfully, but these errors were encountered: