Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Where the thread start after been notified?  RSS feed

 
Xiaolu Gao
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 221
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!