Message from JavaScript discussions

December 2018

— RAF, rIC, setTimeout, async, promise... yields... etc

— 

HZ is fine-grained concurrency, meaning concurrency occurs for smaller chunks of single functions, so each single function context switches to another one multiple times before it is finished running

— It's not terribly fine-grained, but it's moreso than the JS event loop

— But you can't interleave execution without manually creating each pause / async point

— Yes, in fact coroutines are a cooperative multitasking construct, meant for manual cooperation implemented by a developer

Message permanent page

— But, I said fuck that

— So the compiler figures it out for you

— Voluntary preemptive multitasking is basically "automatic cooperative multitasking"

— Over-engeneering!

— 1. coroutine makes function call
2. call data is saved in queue
3. all other coroutines run
4. the coroutine in #1 finally gets to make the call

Message permanent page

— This is the entire execution model

— There is nothing more to it