| Lesson 7 | Modern Java Thread Lifecycle |
| Objective | Understand the six official thread states in the modern Java Virtual Machine (JVM) |
The Java platform provides a powerful, high-level concurrency model that abstracts most operating system–level scheduling details.
While early versions of Java (such as 1.1) described five conceptual thread states—new, runnable, running, blocked, and terminated—modern Java defines six precise states in the Thread.State enumeration. These states are consistent across JVM implementations and provide a unified model for both traditional platform threads and lightweight virtual threads introduced in Java 19.
start() method has not yet been invoked.
No system resources are yet allocated for execution. Socket.read()) are often still reported as RUNNABLE. synchronized block or method. Once the lock becomes available, the thread transitions back to RUNNABLE. Object.wait() (without a timeout), Thread.join() (without timeout), or LockSupport.park().Thread.sleep(ms), Object.wait(ms), Thread.join(ms), and LockSupport.parkNanos(). After the timeout or notification, the thread transitions back to RUNNABLE. run() method completed normally or due to an uncaught exception. Once terminated, a thread cannot be restarted. Threads move between these states through specific methods and events:
start() → NEW → RUNNABLEwait() or join() → RUNNING → WAITINGsleep() or wait(ms) → RUNNING → TIMED_WAITINGnotify(), notifyAll(), unpark() → WAITING/TIMED_WAITING → RUNNABLErun() completes → RUNNING → TERMINATED
Early threading models included methods like stop(), suspend(), and resume().
These were removed in modern Java because they could lead to deadlocks and data corruption.
Instead, developers should use interruption (Thread.interrupt()), concurrency utilities (such as java.util.concurrent), or explicit signaling through LockSupport.
Modern Java provides a clean, standard model of thread behavior that aligns with both traditional OS threads and the new virtual thread framework. By understanding these six states, developers can reason more effectively about concurrency, synchronization, and performance in multi-threaded applications.