4 ms·
Anyone interested in coroutines for JavaScript?
- bikamonki 11y agoThe fact that console is logging from xfrom y on the same line means both executed at the same time?
- voodooattack 11y agoYeah, they're all executing on different cores.
- bikamonki 11y agoBut why then are there skipped (empty) lines on the console (that seem to correspond to the parallel executions)? Strange behaviour.
- voodooattack 11y agoThis happens when there is no synchronization involved, the engine is printing line endings in a separate operation, so they come out weird like that. I'll add a mutex locking mechanism on console I/O at some point in the future.
- bikamonki 11y agoI see. One advantage over web workers is that the DOM would be accesible so this could be used to speed up views rendering.