January 2019
Intermediate to advanced
392 pages
10h 11m
English
Each coroutine and thread has its own call stack. This means that a coroutine or a thread is created along with its call stack. A call stack contains something like blocks for each function that is invoked using a context of this thread or coroutine. This block represents a memory space that contains metadata, primitive local variables, and local references to objects in the heap. You can consider a call stack a part of the memory that is allocated for a thread or coroutine.
The following diagram shows how a Call stack looks when a thread or coroutine is created:

If the main() function invokes another function, a new block is added ...
Read now
Unlock full access