Skip to main content
2 of 3
fix spelling
Kilian Foth
  • 111k
  • 45
  • 301
  • 323

Conceptually what does it mean when it is said that each thread gets its own stack?

I have been reading [Java Concurrency in Practice by Brian Goetz][1] and inside the section Stack Confinement it is mentioned that each thread gets its own stack and so local variables are intrinsically confined to the executing thread; they exist on the executing threads stack, which is not accessible to other threads. What does he mean that each thread has its own execution stack ?

Geek
  • 5.2k
  • 8
  • 43
  • 59