Assuming I’ve properly initialized each thread via ‎`wasm_rt_init_thread()`, is it undefined behavior to instantiate a module in thread A and then call into the instance in threads B, C, D, *etc*.? We can assume only one thread ever calls into the instance at any time.

Based on some quick tests, this behavior appears to be supported, but I’m not sure I trust it—I think I might just be a bit lucky at the moment.

I’m happy to investigate this further on my own, but I thought I’d just ask before going down that rabbit-hole.

Thank you!
wasm2c: Are module instances truly thread-safe?
This is a GitHub Issue
repo:wabt
owner:WebAssembly
Title : wasm2c: Are module instances truly thread-safe?
Issue date:

--- start body ---
Assuming I’ve properly initialized each thread via ‎`wasm_rt_init_thread()`, is it undefined behavior to instantiate a module in thread A and then call into the instance in threads B, C, D, *etc*.? We can assume only one thread ever calls into the instance at any time.

Based on some quick tests, this behavior appears to be supported, but I’m not sure I trust it—I think I might just be a bit lucky at the moment.

I’m happy to investigate this further on my own, but I thought I’d just ask before going down that rabbit-hole.

Thank you!
--- end body ---
