Hello,

I am trying to porting to Emscripten some emulators that do *not* have a 
single processing+rendering loop (that could be easily broken up and called 
via an emscripten_set_main_loop callback), and for which I am concerned 
about slow Emterpreter performance.  I have been able to get a 
infinitely-running rendering loop going in Chrome, using an 
Emscripten-compiled program, and without hanging the browser, however it 
seems to require putting a usleep() call within the 'worker' thread's 
loop.  Not doing so both, for me, hangs Chrome, as well as my computer 
in-general (a relatively recent MacBook Pro).

I am okay, in this case and for the time being, having to turn on 
experimental features in my web browser.  I turned on WebAssembly Threads 
in Chrome, for example (Chrome Version 72.0.3626.121,  on MacOS 10.14.3, 
via chrome://flags/#enable-webassembly-threads ).

Experimental, tested-working code that I created for this is posted at 
https://gist.github.com/DavidLudwig/69800375f0a06e3f9008197d2c816ede

Does anyone know, or have thoughts on whether my idea of moving a program's 
indefinitely-running loops into a separate thread/Web-Worker is a sound 
one, given current tech?  If it is, does a regular invocation of usleep() 
(or a similar, thread-sleeping call) seem necessary?

Cheers,
-- David Ludwig

-- 
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 [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to