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

Notify all  RSS feed

 
Sudhanshu Mishra
Ranch Hand
Posts: 238
1
Eclipse IDE Fedora Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
I have a question regarding notifyall(),wait() and notify().
What if i notify a thread which is not waiting on an objects lock,i.e what if the code with notify() runs before the code with wait()?
 
Piyush Joshi
Ranch Hand
Posts: 207
Eclipse IDE Firefox Browser jQuery
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sudhanshu Mishra wrote: what if the code with notify() runs before the code with wait()?

then nothing will happen.
For example:


thread2 will keep on waiting on lock1.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!