Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
Anyone interested in coroutines for JavaScript?
(
dropboxusercontent.com
)
1 point
by
voodooattack
on April 10, 2016
|
hide
|
past
|
favorite
|
5 comments
bikamonki
on April 10, 2016
[–]
The fact that console is logging from xfrom y on the same line means both executed at the same time?
voodooattack
on April 10, 2016
|
parent
[–]
Yeah, they're all executing on different cores.
bikamonki
on April 10, 2016
|
root
|
parent
[–]
But why then are there skipped (empty) lines on the console (that seem to correspond to the parallel executions)? Strange behaviour.
voodooattack
on April 10, 2016
|
root
|
parent
[–]
This 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
on April 10, 2016
|
root
|
parent
[–]
I see. One advantage over web workers is that the DOM would be accesible so this could be used to speed up views rendering.
Consider applying for YC's Spring batch! Applications are open till Feb 11.
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: