Call Stack

The call stack is a last-in-first-out (LIFO) list of call stack entries, one entry for each called procedure or program. Each call stack entry has information about the automatic variables for the procedure or program and about other resources scoped to the call stack entry, such as condition handlers and cancel handlers.

There is one call stack per thread. A call adds a new entry on the call stack for the called procedure or program and passes control to the called object. A return removes the stack entry and passes control back to the calling procedure or program. See Threads on IBM i for more information.