We have a message queue system for sending work/functions/message between threads. See `emscripten/threading.h`. In particular I think `emscripten_dispatch_to_thread` might be useful to you.
Alternatively you can just use the normal C/C++ mechanisms for inter-thread communication and do it yourself. All the standard C/C++ API for doing this kind of thing should work. On Wed, Oct 20, 2021 at 5:39 AM 'Márton Marczell' via emscripten-discuss < [email protected]> wrote: > Hi, > > Why is Module.onCustomMessage only available in PROXY_TO_WORKER mode? > Would it be possible to enable it in multi-pthreaded applications? We are > in need of a solution to do custom messaging between our threads and the > main thread. > > Márton > > -- > 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]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/emscripten-discuss/87bed389-c756-4bd2-9ab0-5cafcfc756ebn%40googlegroups.com > <https://groups.google.com/d/msgid/emscripten-discuss/87bed389-c756-4bd2-9ab0-5cafcfc756ebn%40googlegroups.com?utm_medium=email&utm_source=footer> > . > -- 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]. To view this discussion on the web visit https://groups.google.com/d/msgid/emscripten-discuss/CAL_va28Dw%3Dy6Byzf%3D1e1p0VJTaM2xg2m6gn1v0M2vTHKyvajRg%40mail.gmail.com.
