Thanks,<br />Lakshmi.
- Do not try and bend the spoon. That's impossible. Instead, only try to realize the truth. - What truth? - That there is no spoon!!!
- Do not try and bend the spoon. That's impossible. Instead, only try to realize the truth. - What truth? - That there is no spoon!!!
Originally posted by Vicken Karaoghlanian:
I still think that Mohit is correct. Threads releases their locks on object when the wait() method is called.
Thread release the lock and enter wait state. Another thread acquires the lock. That thread has to invoke notify/notifyAll so that the first thread which is waiting gets a chance to execute.
- Do not try and bend the spoon. That's impossible. Instead, only try to realize the truth. - What truth? - That there is no spoon!!!
Dislike your old post which you deleted.
It has 3 years since I have actually used Threads in real life. Yes, I did study threads for SCJP but not much.
That is why Javaranch is great , nice way to brush various technologies and mistakes are all caught.
- Do not try and bend the spoon. That's impossible. Instead, only try to realize the truth. - What truth? - That there is no spoon!!!
wait() method releases the lock on the current object only. If it has also acquired locks on some other objects, it does not release those locks.
- Do not try and bend the spoon. That's impossible. Instead, only try to realize the truth. - What truth? - That there is no spoon!!!
Did you see how Paul cut 87% off of his electric heat bill with 82 watts of micro heaters? |