• Post Reply Bookmark Topic Watch Topic
  • New Topic

difference between wait state and block state

 
puff li
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

What is the difference between wait and block state of a thread?

Thanks in advance.
 
Abimaran Kugathasan
Ranch Hand
Posts: 2066
Clojure IntelliJ IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
wait state means, the thread waits for acquiring the lock of that object. But block state means, the thread is blocked for a period not doing any thing!
 
puff li
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Then, if a thread A calls B.join(), should A be in wait state or block state?
 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Java Windows XP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
li hao wrote:Then, if a thread A calls B.join(), should A be in wait state or block state?


http://download-llnw.oracle.com/javase/1.5.0/docs/api/java/lang/Thread.State.html

now you understand the state of your *waiting* thread A?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!