Simon Sandström
unread,Oct 2, 2019, 8:28:23 AM10/2/19Sign 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 emscripte...@googlegroups.com
Hello,
I have an application that first creates and setups a WebSocket, like
this:
ws = emscripten::val::global("WebSocket").new_(emscripten::val(...));
ws.set("onopen", emscripten::val::module_property("onopen"));
ws.set("onmessage", emscripten::val::module_property("onmessage"));
and then it sets a main loop with emscripten_set_main_loop(...).
Everything works fine right now as there are no shared resouces between
onopen/onmessage and the code that is run in the main loop, but in the
future it will be.
Is my application multi-threaded? Can the onopen/onmessage event fire
and execute at the same time as my main loop? Answers online are mostly
old and says that there are no multi-threading in browser JavaScript,
but what about web workers? Are they involved in this scenario?
- Simon