O'Reilly logo

Programmer's Guide to Java™ Certification, A: A Comprehensive Primer, Second Edition by Rolf W. Rasmussen, Khalid A. Mughal

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

9.5. Thread Transitions

Thread States

Understanding the life cycle of a thread is valuable when programming with threads. Threads can exist in different states. Just because a thread's start() method has been called, it does not mean that the thread has access to the CPU and can start executing straight away. Several factors determine how it will proceed.

Figure 9.3 shows the states and the transitions in the life cycle of a thread.

  • Ready-to-run state

    A thread starts life in the Ready-to-run state (see p. 369).

  • Running state

    If a thread is in the Running state, it means that the thread is currently executing (see p. 369).

  • Dead state

    Once in this state, the thread cannot ever run again (see p. 380).

  • Non-runnable states

    A running thread can transit to ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required