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



Subscribe to Tutorials

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. java.lang.IllegalArgumentException
at java

View Tutorial          By: gopal at 2011-03-21 00:45:51

2. Excelente, y a pesar de que mi inglés no es
View Tutorial          By: Monica at 2009-03-24 13:53:51

3. javax.comm.NoSuchPortException
at javax.co

View Tutorial          By: nikhil at 2009-07-22 05:58:55

4. hi every body i want full java code to send messag
View Tutorial          By: Ashray P Shetty at 2010-11-09 04:33:45

5. So I appreciate this website, however... would it
View Tutorial          By: Christina at 2013-02-06 16:46:12

6. hey i need a sms recieving code....
View Tutorial          By: Kishore at 2009-08-06 09:11:13

7. Hi,
Pls help me.I need a full java code wit

View Tutorial          By: karan at 2009-11-26 11:29:56

8. nice one superb..
View Tutorial          By: Rajesh B at 2011-02-01 21:59:56

9. Hi, this blog answers my questions but what is the
View Tutorial          By: Edu at 2009-09-20 00:19:27

10. plz answr for questions about time out problem whl
View Tutorial          By: rrai at 2013-08-26 06:06:57