This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Java Interview Guide and have Anthony DePalma on-line!
See this thread for details.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Wating/blocking/sleeping Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Wating/blocking/sleeping" Watch "Wating/blocking/sleeping" New topic


Angela lewis
Ranch Hand

Joined: Mar 01, 2004
Posts: 100
Is a thread considered to be alive while it is in one of these 3 states.

I thought they shouldn't be because they are not in runnable state. But i read in a book that thread in blocked state is alive.
Why is it so and what about other states?

Swamy Nathan
Ranch Hand

Joined: May 16, 2004
Posts: 187

The Life Cycle of a Thread

not runnable=Wating/blocking/sleeping

The isAlive method returns true if the thread has been started and not stopped. If the isAlive method returns false, you know that the thread either is a New Thread or is Dead. If the isAlive method returns true, you know that the thread is either Runnable or Not Runnable. You cannot differentiate between a New Thread or a Dead thread. Nor can you differentiate between a Runnable thread and a Not Runnable thread.

Read all about it at
I agree. Here's the link:
subject: Wating/blocking/sleeping
It's not a secret anymore!