Difference between “call stack” and “thread stack”

前端 未结 4 1646
粉色の甜心
粉色の甜心 2021-02-01 08:42

Is there a semantic difference between the terms call stack and thread stack, in Java multithreading?

4条回答
  •  挽巷
    挽巷 (楼主)
    2021-02-01 09:21

    A call stack is a stack data structure that stores information about the active subroutines of a computer program.

    What you're calling a thread stackis what i assume is the private stack of a thread.

    These two things are essentially the same. They are both stack data structures.

    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

    Since there usually is only one important call stack, it is what people refer to as the stack.

    Here is information about the stack.

    Here is information about Stack-based memory allocation.

提交回复
热议问题