What are different thread states in Java

Carvia Tech | July 05, 2019 | 2 min read | 33 views

A thread in JVM can have 6 different states as defined in Thread.State enum. At any given time, thread must be in any of these states.


This state is for a thread which has not yet started.


This state is for the currently running thread which is executing in java virtual machine, but it may be waiting for the other resources from operating system such as processor.


Thread state for a thread blocked waiting for a monitor lock. A thread in this state can be waiting for a monitor lock to enter a synchronized block/method or reenter a synchronized method after calling Object.wait().


A thread is waiting due to calling on one of the method -

  • Object.wait with no timeout

  • Thread.join with no timeout

  • LockSupport.park

A Thread in this state is waiting for another thread to perform a particular action. For example, a thread that has called Object.wait() on an object is waiting for another thread to call Object.notify() or Object.notifyAll() on that object. A thread that has called Thread.join() is waiting for a specified thread to terminate.


Thread state for a waiting thread with a specified waiting time. A thread is in the timed waiting state due to calling one of the following methods with a specified positive waiting time -

  • Thread.sleep

  • Object.wait with timeout

  • Thread.join with timeout

  • LockSupport.parkNanos

  • LockSupport.parkUntil


Thread state for a terminated thread. The thread has completed execution.


This content has been taken directly from the Java Docs - Thread.State enum.

Top articles in this category:
  1. Multi-threading Java Interview Questions for Investment Bank
  2. Java Concurrency Interview Questions
  3. Citibank Java developer interview questions
  4. Morgan Stanley Java Interview Questions
  5. RBS Java Programming Interview Questions
  6. UBS Java Interview Questions
  7. BlackRock Top Java Interview Questions: Investment Banking Domain

Find more on this topic:
Java Interviews image
Java Interviews

Interview - Product Companies, eCommerce Companies, Investment Banking, Healthcare Industry, Service Companies and Startups.

Last updated 1 week ago

Recommended books for interview preparation:

This website uses cookies to ensure you get the best experience on our website. more info