| Author |
difference between wait state and block state
|
puff li
Greenhorn
Joined: Jul 28, 2010
Posts: 22
|
|
Hi,
What is the difference between wait and block state of a thread?
Thanks in advance.
|
 |
Abimaran Kugathasan
Ranch Hand
Joined: Nov 04, 2009
Posts: 2066
|
|
|
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!
|
|BSc in Electronic Eng| |SCJP 6.0 91%| |SCWCD 5 92%|
|
 |
puff li
Greenhorn
Joined: Jul 28, 2010
Posts: 22
|
|
|
Then, if a thread A calls B.join(), should A be in wait state or block state?
|
 |
Seetharaman Venkatasamy
Ranch Hand
Joined: Jan 28, 2008
Posts: 5575
|
|
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?
|
 |
 |
|
|
subject: difference between wait state and block state
|
|
|