CIS 35A: Introduction to Java Programming

Home | Green Sheet | Lectures | Assignments | FAQ | Grades

Threads

Threads
Introduction
Life cycle

The life cycle of a thread

Thread states

State Description
New The thread has been created (its constructor has been called), but not yet started.
Runnable The thread's start method has been called and the thread is available to be run by the thread scheduler.
Blocked The thread has been temporarily removed from the Runnable state. This can happen if the thread's sleep method is called, if the thread is waiting on I/O, or if the thread requests a lock on an object that's already locked.
Waiting The thread has called its wait method so that other threads can access an object.
Terminated The thread's run method has ended.
Previous | Concepts | How threads work | Typical uses for threads | Classes and interfaces | Life cycle | Next