tag:blogger.com,1999:blog-8712770457197348465.post3274885578981203570..comments2024-03-28T02:47:19.159-07:00Comments on Javarevisited: Difference between notify and notifyAll in Java - When and How to usejavin paulhttp://www.blogger.com/profile/15028902221295732276noreply@blogger.comBlogger5125tag:blogger.com,1999:blog-8712770457197348465.post-11350570110958526812014-06-17T18:56:53.082-07:002014-06-17T18:56:53.082-07:00Thank you so much. Sample program is really good.Thank you so much. Sample program is really good.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-8712770457197348465.post-30980053695571113572013-11-25T18:40:02.144-08:002013-11-25T18:40:02.144-08:00One of the main reason, why you will use notifyAll...One of the main reason, why you will use notifyAll over notify is number of conditions, which can cause a thread to wait. If your thread can wait due to multiple conditions, then you must call notifyAll() method, as you don't have ability to notify threads for specific conditions. This limitation is sorted out by ReentrantLock and Condition, ReentrantLock.newCondition() provides ability to Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-8712770457197348465.post-35812276132047769322013-09-23T00:42:53.088-07:002013-09-23T00:42:53.088-07:00One more thing..these methods can't be overrid...One more thing..these methods can't be overridden. These are defined as final methods. For more interview questions, please visit: <br />http://ankitagarwaljava.blogspot.in/Ankit Agarwalhttps://www.blogger.com/profile/11481670774445905664noreply@blogger.comtag:blogger.com,1999:blog-8712770457197348465.post-18146949579788993542013-05-03T08:02:09.986-07:002013-05-03T08:02:09.986-07:00I understand real difference between notify and no...I understand real difference between notify and notifyAll by seeing its effect while implementing ReadWriteLock. in ReadWriteLock, when writer finished writing, it has to notify all reader and other writers which are waiting for lock. Now if it used just notify in place of notifyAll then it might happen that a reader woke up and goes to sleep without doing anything because another writer is Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-8712770457197348465.post-16633361262816461602012-11-01T19:07:33.636-07:002012-11-01T19:07:33.636-07:00Good article for those who write low level Java fr...Good article for those who write low level Java framework code.<br />Exactly because it is so easy to confuse things and introduce bugs, it is recommended for any application level code to use higher level frameworks such as the java util concurrent package http://www.ibm.com/developerworks/java/library/j-5things4/index.html or frameworks like akka.io.<br />Anonymoushttps://www.blogger.com/profile/16815999018553645136noreply@blogger.com