Saturday, 21 October 2017

stack



Every thread got its own stack which is used for maintaining local variables of functions and for passing arguments to functions executing inside a thread. When a function executes, it may add some of its state data to the top of the stack like arguments and local variables, when the function exits it is responsible for removing that data from the stack. Apart from that, a thread's stack is used to store the location of function calls in order to allow return statements to return to the correct location
 Image result for thread stack

No comments:

Post a Comment