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. thank u. it is very useful for users
View Tutorial          By: c.balasubramani at 2008-09-24 03:55:47

2. This is very clear and explains the concepts in a
View Tutorial          By: Reite at 2011-02-18 13:55:07

3. thank u its a clear information .i got the solutio
View Tutorial          By: anand at 2011-06-29 09:30:12

4. superb its working perfect but one thing, we have
View Tutorial          By: venkatachalam at 2013-03-14 16:35:00

5. @Sonal, as long as the image is stored in a server
View Tutorial          By: alex at 2012-11-07 07:25:40

6. great resource
View Tutorial          By: Anonymous at 2011-04-14 03:14:43

7. Plz send code of sending sms from java code...

View Tutorial          By: Shekh at 2014-11-27 14:18:25

8. why we use the java in networking and What are the
View Tutorial          By: ali mohammed at 2015-10-11 22:34:36

9. can anybody suggest me to write a java prog. to ke
View Tutorial          By: Giri at 2015-03-23 17:56:58

10. thank you, this best for student like us,
View Tutorial          By: Srinath at 2012-05-12 15:04:03