Threads Command

The threads command provides the state of the logical threads, which are usually mapped one-for-one to physical operating systems. Threads are shown along with their state.

The following table lists and describes the possible thread states.

Thread State

Description

NEW

This state represents a new thread, which is not yet started.

RUNNABLE

This state represents a thread which is executing in the underlying JVM. In this case, executing in JVM does not necessarily mean that the thread is always executing in the operating system as well. It may wait for a resource from the operating system, such as the processor, while being in this state.

BLOCKED

This state represents a thread that has been blocked and is waiting for a monitor to enter or re-enter a synchronized block or method. A thread gets into this state after the Object.wait method is called.

WAITING

This state represents a thread in the waiting state, where the wait is over only when some other thread performs some appropriate action. A thread can get into this state either by calling a wait method with no time-out option. The thread depends on the actions of some other thread.

TIMED_WAITING

This state represents a thread which is required to wait at max for a specified time limit. A thread can get into this state by calling a wait method with a time-out option. That is, the thread can run either when another thread completes some action or a clock expires.

TERMINATED

This state represents a thread which has completed its execution either by returning its execution method after completing the execution or by throwing an exception which caused the termination of the thread.


iWay Software