Home » Java programming language

Explain life cycle of a thread in java

In this article, we are going to learn about thread life cycle, what is life cycle of a thread in java? What are the different states in life cycle of a thread in java?
Submitted by Preeti Jain, on February 06, 2018

Thread Life Cycle (different states of a thread)

There are few states of Thread life cycle,

  1. New State
  2. Ready State
  3. Running State
  4. Dead State
  5. Waiting State
  6. Sleeping State
  7. Suspended State

We will study all the states described above:

1) New state

When thread is instantiated or created then thread will be in new state.


NewThread nt = new NewThread();

2) Ready state

When we call start() method on thread object then our thread will be in ready state (i.e. get ready to enter in running state).



3) Running state

Here, we discuss one thing before entering in running state. What is the role of thread scheduler thread scheduler allocates processor to the waiting threads based on priority. Our thread will be in running state when thread scheduler allocate processor to the thread means that thread will get a chance to execute.

4) Dead or Terminated state

When run() method completes their execution then our thread will be in dead state or last state.

5) Running → Ready

If a running thread calls yield() method then our running thread will be in running to ready state because yield() stop executing and give a chance to other waiting thread.



6) Waiting state

If a running thread calls join() method then our thread will be in waiting state because join() waits until completing some other thread. If thread comes out from (waiting to ready) state there are two conditions:

  1. If waiting thread got interrupted.
  2. If time expires.



7) Sleeping state

If a running thread calls sleep() method then our thread will enter into sleeping state and there are few cases when sleeping thread come out from (sleeping to ready state):

  1. If time expires.
  2. If sleeping thread got interrupted.



7) Suspended state

When a running thread call suspend() method then our running thread will be in suspended state and suspended thread come out in ready state by calling resume() method.




  1. How to Create Java Threads (java examples to create threads)?
  2. Thread Synchronisation in Java with Example.
  3. Java program to demonstrate example of thread.
  4. Java program to Join Threads.


Comments and Discussions



Languages: » C » C++ » C++ STL » Java » Data Structure » C#.Net » Android » Kotlin » SQL
Web Technologies: » PHP » Python » JavaScript » CSS » Ajax » Node.js » Web programming/HTML
Solved programs: » C » C++ » DS » Java » C#
Aptitude que. & ans.: » C » C++ » Java » DBMS
Interview que. & ans.: » C » Embedded C » Java » SEO » HR
CS Subjects: » CS Basics » O.S. » Networks » DBMS » Embedded Systems » Cloud Computing
» Machine learning » CS Organizations » Linux » DOS
More: » Articles » Puzzles » News/Updates

© some rights reserved.