• Post Reply Bookmark Topic Watch Topic
  • New Topic

thread calls wait and no other thread calls notifyAll or notify

 
Moni Patil
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What happens when a thread calls wait and no other thread calls notifyAll or notify
 
Tom Hill
Ranch Hand
Posts: 115
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi there!
The thread will keep waiting until it is notified.
And if it isnt notified, it will attempt to wait forever.

So youll probably kill the process by some means.


Tom
 
Layne Lund
Ranch Hand
Posts: 3061
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In at any time, all threads call wait() without calling notify() or notifyAll(), then it is called a deadlock. The process will continue to run without doing anything, so this should be avoided at all costs.

Layne
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!