Monday, April 5, 2010

Different Thread State

There can be following states:

  1. NEW ---> A thread that has not yet started is in this state. In this state, no system resources have been allocated as yet.
  2. RUNNABLE ---> Once start method is invoked thread enter in this state.
  3. BLOCKED ---> A thread that is blocked waiting for a monitor lock is in this state.
  4. WAITING ---> A thread that is waiting indefinitely for another thread to perform a particular action is in this state.
  5. TIME_WAITING ---> A thread that is waiting for another thread to perform an action for up to a specified waiting time is in this state.
  6. TERMINATED ---> A thread that has exited is in this state.
These states are related to JVM not operating system thread states.

No comments:

Post a Comment