Just stumbled across the "asyncify" Wiki page by chance. Does this really 
do what it promises to do and without major performance degradations? As I 
understand, it breaks up a synchronous function, which makes a call to 
emscripten_sleep into two asynchronous functions, where the second one 
becomes a callback for the underlying setTimeout call. And as one cannot 
programmatically store and recover the stack in Javascript, the same needs 
to be be done all the way up in the call stack. For one, I would imagine 
this to be more costly than unwinding a plain synchronous call stack and 
secondly (to my knowledge), asm.js doesn't currently support function 
parameters, or does it? In other words, the asyncify-ed code wasn't asm.js 
compliant with accompanying performance implications in Firefox.  

But regardless, once this lands one can actually think of truly supporting 
shared-state multithreading (POSIX threads) by supporting seemingly 
synchronous worker communication for locking operations etc. This might 
also need some (compile-time) changes to the memory management approach to 
be able to "trace" what heap addresses are changed by some thread. 

Fantastic work!

Soeren

-- 
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