The easiest way is probably to use the same techniques you would use on a native platform: communicate through shared memory and use the low level pthread APIs such as pthread_cond_signal/wait APIs
Alternatively you could use the APIs in `emscripten/threading.h` that handle running code on another thread. e.g. emscripten_dispatch_to_thread (there are built on shared memory and pthreads under the hood so its fundamentally the same mechanism).
Finally, if you have a workers that yield to the JS event loop you could try to use JavaScripts postMessage rather than shared memory to communicate. However the postMessage channel is currently managed my emscripten itself so I'm not sure how easy it would be to hook into that mechanism.
cheers,
sam
--
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/CAHqdETyQ7VehPxEzTFqkKOZ_HrVqZoOefX%3DVnTqtq163xqnm9A%40mail.gmail.com.