Sync non-busy sleep() for JavaScript

160 views
Skip to first unread message

Lu Wang

unread,
Dec 4, 2013, 3:13:52 PM12/4/13
to emscripten-discuss
Hi all,

  If you think I'm another JS beginner who is reasking this question: I'm not. I'm attempting to answer it. :)

  And here it is: Hypnotic: Let JavaScript Sleep()! Please enjoy the demo and I won't spoil it here.

  In a few days I'll try to figure out how it could work together with emscripten, hopefully it can solve a few issues that have been worrying me (and many others) for a long time. 


  regards,
  - Lu Wang
 

Soeren Balko

unread,
Dec 4, 2013, 5:25:44 PM12/4/13
to emscripte...@googlegroups.com
What a fantastic approach! With that pattern, we could get rid of all sorts of clumsy hacks for calling asynchronous JS APIs from the (necessarily synchronous) emscripten-ed code. In fact, a generic sync-async bridge was doable with this.

Other than that, I could even imaging a "hibernate" feature for a running "instance" of emscripten-ed code where we could suspend the run at any time (without unwinding the stack), take a snapshot of the heap, call stack, etc. and put it into some local persistence.

Alon Zakai

unread,
Dec 10, 2013, 2:53:10 PM12/10/13
to emscripte...@googlegroups.com
Very interesting. This runs its own interpreter, if I understand it correctly? Would be very interesting to see the performance impact on emscripten code.

- Alon



--
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.
For more options, visit https://groups.google.com/groups/opt_out.

王璐

unread,
Dec 16, 2013, 12:09:22 AM12/16/13
to emscripte...@googlegroups.com
Yes it's basically Narcissus + streamline.js
It introduces huge overhead, so I figured it is not practical.


regards,
- Lu
To unsubscribe from this group and stop receiving emails from it, send an email to emscripten-discuss+unsub...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages