File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Threads and Synchronization and the fly likes Where the thread start after been notified? Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Threads and Synchronization
Reply Bookmark "Where the thread start after been notified?" Watch "Where the thread start after been notified?" New topic
Author

Where the thread start after been notified?

Xiaolu Gao
Greenhorn

Joined: Nov 21, 2000
Posts: 8
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
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Where the thread start after been notified?
 
Similar Threads
S&B 1.5 Chapter 9, question 10
Doubt on wait() and notify(). SCJP K&B book.
Thread Question
Thread Question - wait() method
I passed, but I suffered the 44/80 locking penalty. Why?