Call Stack

In computer science, a call stack is a stack data structure that stores information about the active subroutines of a computer program. This kind of stack is also known as an execution stack, control stack, run-time stack, or machine stack, and is often shortened to just "the stack". Although maintenance of the call stack is important for the proper functioning of most software, the details are normally hidden and automatic in high-level programming languages.

A call stack is used for several related purposes, but the main reason for having one is to keep track of the point to which each active subroutine should return control when it finishes executing. An active subroutine is one that has been called but is yet to complete execution after which control should be handed back to the point of call. Such activations of subroutines may be nested to any level (recursive as a special case), hence the stack structure. If, for example, a subroutine DrawSquare calls a subroutine DrawLine from four different places, DrawLine must know where to return when its execution completes. To accomplish this, the address following the call instruction, the return address, is pushed onto the call stack with each call.

Read more about Call Stack:  Description, Functions of The Call Stack, Structure, Call Stack Inspection, Performance Analysis, Security

Famous quotes containing the words call and/or stack:

    At length he would call to let us know where he was waiting for us with his canoe, when, on account of the windings of the stream, we did not know where the shore was, but he did not call often enough, forgetting that we were not Indians.... This was not because he was unaccommodating, but a proof of superior manners. Indians like to get along with the least possible communication and ado. He was really paying us a great compliment all the while, thinking that we preferred a hint to a kick.
    Henry David Thoreau (1817–1862)

    “Farewell to barn and stack and tree,
    Farewell to Severn shore.
    Terence, look your last at me,
    For I come home no more.
    —A.E. (Alfred Edward)