Comment on Tutorial - wait(), notify() and notifyAll() in Java - A tutorial By Jagan



Comment Added by : Pranay

Comment Added at : 2012-09-19 19:08:45

Comment on Tutorial : wait(), notify() and notifyAll() in Java - A tutorial By Jagan
Hi,
Even if the while loops (in Producer and Consumer's run method ) in 27's code is made limited to a certain cycle then also 27's code could result into a thread (any one of producer or consumer) waiting indefinitely or for a long time.
This would happen as notify() is not present before returns from put() and get() methods. So there are chances when one of the thread could lead to a forever waiting state.


View Tutorial



Related Tutorials

Program using concept of byte long short and int in java

Update contents of a file within a jar file

Tomcat and httpd configured in port 8080 and 80

Java File

Java String

Count number of vowels, consonants and digits in a String in Java

Reverse a number in Java

Student marks calculation program in Java

Handling Fractions in Java

Calculate gross salary in Java

Calculate average sale of the week in Java

Vector in Java - Sample Program

MultiLevel Inheritance sample in Java

Multiple Inheritance sample in Java

Java program using Method Overriding

Archived Comments

1. This is great, hope to learn more from this commun
View Tutorial          By: Wamaguru at 2014-07-12 09:05:30

2. really a gud work for xml parsing readers
View Tutorial          By: shreya at 2010-07-02 02:35:04

3. excellent code.....
View Tutorial          By: Anonymous at 2009-05-07 03:09:01

4. hi .the program does run thank you for that ,i nee
View Tutorial          By: mazen at 2008-09-09 04:55:16

5. You are using stl; why do it by hand? All you nee
View Tutorial          By: gavin at 2013-02-21 12:31:29

6. I want to use concept of overriding and i want to
View Tutorial          By: Aniket at 2013-06-20 10:23:10

7. Very nice one, it really helps me. Thank you very
View Tutorial          By: eky1412 at 2012-09-10 03:45:07

8. Good Work ...
View Tutorial          By: Sagan at 2013-08-13 13:38:30

9. The code for CharArrayReader is not working. So, w
View Tutorial          By: Maya Joshi at 2012-06-23 14:30:26

10. When trying to install Java

i was

View Tutorial          By: Sinmo at 2009-08-30 00:31:33