When should I use notify() instead of notifyAll() for thread communications with wait()?

John Mitchell

The simple answer is to always use notifyAll() unless you understand enough to know better. If you're reading this question and are wondering if you know better then you probably don't. :-)

The next thing to do if you really want to know is to get a copy of Doug Lea's Concurrent Programming in Java Second Edition: Design Principles and Patterns and read it and place with the examples and read it again.

If you're still just too impatient to do all of that then at least go get Doug's book and use his utility classes.

0 Comments  (click to add your comment)
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

About | Sitemap | Contact