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. hey dude
im using vb.net 2008 and sql serv

View Tutorial          By: Haseeb ur Rehman at 2010-11-12 02:08:48

2. Hats off man !!! Very Simple & Straightforward
View Tutorial          By: Nitesh at 2013-01-06 00:50:53

3. Its very clearly explained.
View Tutorial          By: sowjanya at 2013-10-04 09:26:04

4. if (fget(y,100,fp2)!=10);
what should be th

View Tutorial          By: ruqsar at 2014-02-10 10:54:32

5. Thanks very much....its very simple explained.....
View Tutorial          By: nizam at 2012-12-17 09:43:11

6. This is very good article.
View Tutorial          By: Vipin Joshi at 2008-03-27 13:53:26

7. Change the line from
imgView.setBackgroundR

View Tutorial          By: laki at 2012-05-02 08:59:25

8. i am a bca student. i want to know more about garb
View Tutorial          By: ahana at 2011-06-26 11:02:36

9. Hi,
can anyone show or send me a sample pro

View Tutorial          By: jsn10 at 2011-09-14 05:41:03

10. Hi,

Thanks a lot to the writer of t

View Tutorial          By: Bhushan at 2007-04-27 04:56:00