Hi,
It looks like recent versions of V8's JS shell support web workers, so it is possible to run emscripten+pthreads in this shell. This is useful for running test suites which
use threads as it requires less work than running in the browser.
Ran into the following problems:
- the message received by onmessage () is not wrapped in a 'data' property. This might be a bug in D8.
- the main threads onmessage () seems to be only called when control returns to the main loop which never seems to happen in the JS shell, so the 'loaded' message
is never received by the main thread, so startup fails. Worked around it by receiving the message synchronously using worker.getMessage () and passing it to
onmessage (). Couldn't find too much documentation on getMessage (), is it a V8 extension ?
Here is a commit with the changes:
Wanted to discuss these isues before making it into a PR.
Zoltan