A thread can be in one of the following states:
-
NEW
Threads that have not yet started are in this state. -
RUNNABLE
A thread executing in the Java Virtual Machine is in this state. -
BLOCKED
A thread that is blocked and waiting for a monitor lock is in this state. -
WAITING
A thread that waits indefinitely for another thread to perform a particular operation is in this state. -
TIMED_WAITING
A thread waiting for another thread to perform an operation that depends on the specified wait time is in this state. -
TERMINATED
An exited thread is in this state.
Calling thread-related methods is the main reason for changing the state, and the causal relationship is shown in the figure:
Image source: Concurrent Multithreading Core Programming Technology.pdf_ by Gao Hongyan.