3 ms·
This seems pretty low level. When I wanted async wasm execution (to run multithreaded game ai simulation or to run game ai outside of UI thread) I was able to g
by __s 3y ago
This seems pretty low level. When I wanted async wasm execution (to run multithreaded game ai simulation or to run game ai outside of UI thread) I was able to go with WebWorkers using a small script: https://github.com/serprex/openEtG/blob/master/src/AiWorker.js https://github.com/serprex/openEtG/blob/master/src/AiWorker.... (worker code here: https://github.com/serprex/openEtG/blob/master/src/ai.worker.js https://github.com/serprex/openEtG/blob/master/src/ai.worker...)
Having the async at the WASM level would help avoid having overhead from serialize/deserialize between web workers. I wrote this years ago, so not sure what progress has been made for having the wasm module running multiple threads. On that front you may still be better off spawning multiple wasm modules