Tutoriallearn.com

Easy Learning


Home

Search Tutoriallearn.com :



Life Cycle of Thread

The life cycle of a thread consists of states which are described below:

New:- When a thread is created, then it is in New state.

Runnable:- When a thread is started using start() function, then it is in Runnable state . In this state, the thread is executing its task.

Waiting:- When a thread waits for another thread (or for I/O operation to be completed), then it is in the waiting state. After waiting state, the thread comes back to Runnable state.

Waiting state can be timed waiting: - A waiting state can be set for specified interval of time. Then it is called timed waiting state.

Terminated state (Dead state) :- :- When a thread competes its task, then it enters into terminated state.

The following diagram shows the life cycle a thread:







© Copyright 2016-2026 by tutoriallearn.com. All Rights Reserved.