--
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-disc...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/emscripten-discuss/aecd43c5-6662-4d7d-bb8c-15461e75522e%40googlegroups.com.
It is not safe to start an async operation while another is already running. The first must complete before the second begins.
--
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-disc...@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.
Not sure if this relates... I had a very similar issue with a node addon, and promises just not resolving. I'm not sure specifially how your browsers Promises get scheduled, but in V8, the library schedules them as microtasks, that you basically have to call process.tick() in order to kick that event loop. I don't know if the same functionality exists in the JS browser...You're not supposed to have to worry about such details, but in a thread, if I didn't also call the runmicrotasks sort of thing, the promises resolved never got dispatched.
On Wed, Mar 25, 2020 at 5:52 PM Kevin McGrath wrote:
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+unsub...@googlegroups.com.
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!
To view this discussion on the web visit https://groups.google.com/d/msgid/emscripten-discuss/fe4d60af-6a74-40e6-b37f-31a04eb34afd%40googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to emscripten-discuss+unsub...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/emscripten-discuss/aecd43c5-6662-4d7d-bb8c-15461e75522e%40googlegroups.com.
--
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+unsub...@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to emscripten-disc...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/emscripten-discuss/aecd43c5-6662-4d7d-bb8c-15461e75522e%40googlegroups.com.
--
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-disc...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/emscripten-discuss/fe4d60af-6a74-40e6-b37f-31a04eb34afd%40googlegroups.com.
--
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-disc...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/emscripten-discuss/d4918085-f6bc-4912-94a1-3412763525fe%40googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to emscripten-discuss+unsub...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/emscripten-discuss/aecd43c5-6662-4d7d-bb8c-15461e75522e%40googlegroups.com.
--
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+unsub...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/emscripten-discuss/fe4d60af-6a74-40e6-b37f-31a04eb34afd%40googlegroups.com.
--
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+unsub...@googlegroups.com.