Keith Teo
unread,Dec 6, 2024, 12:33:00 AM12/6/24Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to emscripten-discuss
Hi,
I am trying to benchmark the effects of modifications to various parts of the WASM toolchain. But when running multithreaded emscripten output in d8 I get the error:
Aborted(Assertion failed: Pthreads do not work in this environment yet (need Web Workers, or an alternative to them))
test.js:731: RuntimeError: Aborted(Assertion failed: Pthreads do not work in this environment yet (need Web Workers, or an alternative to them))
throw e;
The error comes from this line:
assert(
ENVIRONMENT_IS_WEB || ENVIRONMENT_IS_WORKER || ENVIRONMENT_IS_NODE, 'Pthreads do not work in this environment yet (need Web Workers, or an alternative to them)');
Anyone know how to get around this? d8 is capable of running web workers, so there's no technical limitation on it.
This is how I compiled my cpp code
em++ -sENVIRONMENT=shell,worker -s ASSERTIONS=2 -s PTHREAD_POOL_SIZE=4 -s WASM=1 -pthread test.cpp -o test.js