Java Multithreading, Concurrency, and Parallelism — Part 4
4 min readJul 18, 2021
Multiple Threads and their Stacks
In part-3 we have seen how threads can be created and we also explored the life cycle of a thread to some extent. In this article, we will look at how threads maintain their local variables and call stacks.
Each thread in Java has a private stack associated with it. When a thread is created in Java Virtual Machine, a JVM stack local to that thread is also created.
Below is a simple java application that has one user-defined thread named MyThread
…