Thread States

In the discussion of Listings 8.1 and 8.2, threads were referred to as dead when their processing had completed. I wasn't trying to be morose. This is the standard Java term for referring to that state of a thread's execution. After a thread reaches the dead state, it cannot be restarted. The thread still exists as an object (that is as a Thread or Runnable object), but it does not execute as a separate thread of execution.

Threads have several other well-defined states in addition to the dead state. These states are as follows:

  • Ready— When a thread is first created, it does not begin executing immediately. You must first invoke its start() method, and then the operating system's thread scheduler must allocate its CPU time. (The ...

Get Sun Certification Training Guide (310-025, 310-027): Java™ 2 Programmer and Developer Exams now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.