'Phil Endecott' via emscripten-discuss wrote:
So - is there some alternative to MAIN_THREAD_ASYNC_EM_ASM that I should use, such that the work is only done when the main thread is actually idle?

It seems that the solution is to create a new emscripten::ProxyingQueue
and add my work to that.

I had previously discounted using that, because I thought that I would
need to arrange to call execute() myself somehow. But that is not the
case:

- All queues are run when their thread is idle; the web workers
postMessage/onMessage mechanism is used to make that happen.

- The "system queue" is additionally run from the yeild() function,
which is called by f/mutex_lock when it blocks.

- MAIN_THREAD_ASYNC_EM_ASM uses the "system queue".

I'm not convinced that having the user-facing
MAIN_THREAD_ASYNC_EM_ASM feature use this special queue
is the right thing to do; wouldn't it be better if it used its own
queue that only ran when the main thread is idle?

Anyway, I now have this working.


Regards, Phil.







--
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 visit 
https://groups.google.com/d/msgid/emscripten-discuss/1756567907739%40dmwebmail.dmwebmail.chezphil.org.

Reply via email to