Life Cycle States :
A thread has been created but not started yet. A thread will be started by calling its start() method.
This state is also called ready to run stage also called queue. A thread starts in runnable state by calling start() method.
The Thread scheduler decides which thread runs and how long.
If a Thread is executing that means Thread is in Running stage.
Once a Thread reached dead state it can not run again.
5. Non runnable States:
A Running Thread transit to one of the non runnable states, depending upon the circumstances.
A Thread remains non runnable until a special transition occurs.
A Thread does not go directly to the running state from non runnable state.
But transits first to runnable state.
- Sleeping: The Threas sleeps for specified amount of time.
- Blocked for I/O: The Thread waits for a blocking operation to complete.
- Blocked for join completion: The Thread waits for completion of another Thread.
- Waiting for notification: The Thread waits for notification another Thread.
- Blocked for lock acquisition: The Thread waits to acquire the lock of an object.