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
issue 1: Cannot find correct .wasm path when run emscripten generated JavaScript in a Node.js Worker.
issue 2: The empty *.worker.js is written in cwd, not the same directory where .js exists.
issue 3: Pthread worker will read incorrect .wasm file again even if I specified locateFile when -sSTRICT=1
The core misunderstand there seems to be that pthreads need to be able to locate the wasm file. In fact pthreads recieve the wasm module via postMessage so they should never be trying to locate or read the wasm file themselves.
I believe the issue that caused some confusion in #21826 was that locateFile is still being called on worker startup, even though the worker is never using the result of that call. I think I will update the code so workers never actaully call locateFile to avoid this confusion.
not sure whether issue 3 is duplicated, but I confirm 1 and 2 are not related to #21826.
I mean run emscripten js in my own Node.js worker (the worker is emscripten's main thread), please take a look the repro code and CI test, it does break something.
Activity
sbc100 commentedon Apr 25, 2024
Is this perhaps a duplicate of #21826?
The core misunderstand there seems to be that pthreads need to be able to locate the wasm file. In fact pthreads recieve the wasm module via postMessage so they should never be trying to locate or read the wasm file themselves.
I believe the issue that caused some confusion in #21826 was that locateFile is still being called on worker startup, even though the worker is never using the result of that call. I think I will update the code so workers never actaully call locateFile to avoid this confusion.
Skip wasmBinaryFile initialization on pthread workers
toyobayashi commentedon Apr 25, 2024
not sure whether issue 3 is duplicated, but I confirm 1 and 2 are not related to #21826.
I mean run emscripten js in my own Node.js worker (the worker is emscripten's main thread), please take a look the repro code and CI test, it does break something.
toyobayashi commentedon Apr 25, 2024
Issue 1 has nothing to do with locateFile, after I experienced issue 1, I tried to use locateFile to solve it then experienced issue 3.
Skip wasmBinaryFile initialization on pthread workers
Skip wasmBinaryFile initialization on pthread workers
Skip wasmBinaryFile initialization on pthread workers
Fix output location for dummy worker.js file
Fix output location for dummy worker.js file
Fix output location for dummy worker.js file
sbc100 commentedon Apr 25, 2024
So we have a fix for (2) in #21830 and (3) in #21829.
That just leaves (1) which still needs some investigation.
Skip wasmBinaryFile initialization on pthread workers
Fix output location for dummy worker.js file (#21830)
Skip wasmBinaryFile initialization on pthread workers (#21829)
Fix pthread + modularize + running in node worker
sbc100 commentedon Apr 25, 2024
Final fix is in #21832. I will push for a new release sooner rather than later to get these fixes out.
Fix pthread + modularize + running in node worker
Fix pthread + modularize + running in node worker (#21832)