JAVA THREAD MODEL

Life cycle of a Thread

thread life cycle
  1. New : A thread begins its life cycle in the new state. It remains in this state until the start() method is called on it.
  2. Runable : After invocation of start() method on new thread, the thread becomes runable.
  3. Running : A method is in running thread if the thread scheduler has selected it.
  4. Waiting : A thread is waiting for another thread to perform a task. In this stage the thread is still alive.
  5. Terminated : A thread enter the terminated state when it complete its task.

1 comment: