April 2018
Beginner
536 pages
13h 21m
English
Concurrency is the ability for two or more operations to be executed simultaneously. The runtime execution takes place on one single thread, which means that we cannot achieve real concurrency.
The event loop follows a run-to-completion approach, which means that it will process a message from beginning to end before any other message is processed.
Every time a function is invoked, a new message is added to the queue. If the stack is empty, the function is processed (the frames are added to the stack).
When all the frames have been added to the stack, the stack is cleared from top to bottom. At the end of the process, the stack is empty, and the next message is processed.