Ah!  Thanks for the details!  I looked into Asyncify and ruled it out 
because of this from the emscripten documentation:

It is not safe to start an async operation while another is already 
> running. The first must complete before the second begins.


  That would mean one HTTP request at a time, one after another, and any 
time we want to use Asyncify for any other async JavaScript tasks we may 
run into trouble that would be a nightmare to debug.  Plus there's more 
issues described in that doc, such as if we get an event (like a keypress) 
while the async JavaScript is running it doesn't sound too stable when it 
calls into compiled code.  Lastly, they mention that you should always run 
optimized builds if you're using Asyncify, which will not be fun to debug.  
Taking all of that into consideration, it didn't sound like a good option 
to me, especially since I wasn't sure it would work in the first place with 
USE_PTHREADS=1.

  I'm not sure I understand how emscripten_set_main_loop() will help my 
JavaScript execute the async code... are you saying that the compiled code 
in each thread is blocking the JavaScript code?

  Sorry for so many questions, I'm very new to JavaScript and know very 
little about its internal workings.  Also seems impossible to Google for 
this kind of stuff.

  Thank you!

-- 
You received this message because you are subscribed to the Google Groups 
"emscripten-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to emscripten-discuss+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/emscripten-discuss/1445b398-abcb-483e-8384-6c5bebfc3e29%40googlegroups.com.

Reply via email to