Suggested Pages

Friday, May 25, 2012

Thread States

Thread states are these shown below.

New

Threads are only created by the JVM after starting thread with start() method.

Ready

The thread is available to the scheduler, waiting to use the processor.

Running

The thread is using the processor.

Time Waiting

The thread must wait a determinate period before resuming.
Methods that take threads to this state are: sleep(long mill),wait(long mill), join(long timeout)

Waiting

Threads are wating for a condition to be verified.
Methods that take threads in this state are: wait(), join()

Blocked

Threads are wating for the availability of an implicit lock (monitor lock) because of synchronized code.

Terminated

A thread that has finished to work

No comments :

Post a Comment

Suggested Pages