1. Thread Life Cycle
Prof. Yashoda M B
Assistant Professor in Computer Science (UG)
Kristu Jayanti College, Autonomous
(Reaccredited A++ Grade by NAAC with CGPA 3.78/4)
Bengaluru – 560077, India
2. States of Thread life cycle
New born
Running
Suspended
Dead
Prof. Yashoda M B
2
11/17/2023
3. Prof. Yashoda M B
3
Newborn
Running Runnable
Active
Thread
yield
start
Blocked
Dead
Suspend
sleep
wait
Resume
notify
stop
stop
stop
Killed
Thread
New Thread
Idle Thread (Not
Runnable)
11/17/2023
4. Prof. Yashoda M B
4
Runna
ble
state
Dead
state
start stop
Newborn
New born state
11/17/2023
5. Prof. Yashoda M B
5
Running
thread
Runnable thread
yield
Running state
11/17/2023
6. Prof. Yashoda M B
6
suspend
suspended
runnable
running
resume
11/17/2023
7. Prof. Yashoda M B
7
sleep(t)
runnable
running
after(t)
suspended
11/17/2023
8. Prof. Yashoda M B
8
wait
runnable
running
notify
waiting
11/17/2023
9. Prof. Yashoda M B
9 Blocked state
• A thread is said to be blocked when it is prevented from entering
into runnable state and subsequently the running state.
• A blocked thread is considered “not runnable” but not dead,
therefore fully qualified to run again.
Dead state
• Every running thread ends its life when it has completed
executing its run() method.
• We can kill it by sending the stop message to it at ant state.
11/17/2023