Hi Everyone, I have a simple question: Where does a waiting thread start after it got notified and obtained the lock from the monitor? Will it continue from where it stopped or start from the very beginning of the synchronized code block? Same question for the thread which get a chance to run after sleep() or yield() ... Thanks a lot !!!
Jerry Pulley
Ranch Hand
Joined: Sep 19, 2000
Posts: 221
posted
0
Xiaolu, In all cases, a blocked thread recommences execution when the blocking method returns. In the case of a waiting thread that gets notified, that's immediately after the wait() call.