File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Wating/blocking/sleeping

 
Angela lewis
Ranch Hand
Posts: 100
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?

thanks
 
Swamy Nathan
Ranch Hand
Posts: 187
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


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

http://java.sun.com/docs/books/tutorial/essential/threads/lifecycle.html
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic