Answers/Solutions to Exercises in Chapter 2, Exercise 6

E6: What is the system stack for?

A6: The system stack is a stack associated with a process (or a thread) --- it is used for execution flow control: when a function is called, its activation frame (where the relevant context of the function is stored) is pushed onto the system stack, and when the function terminates, its activation frame is popped from the stack. This allows for return of control to the point right after the function call. The system stack is also used for passing data between function calls (both the "input" arguments and the "output" return value).

Back to Answers/Solutions Index                          Back to Answers/Solutions for Chapter 2 Index