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. dear sir/madam
I am using netbeans IDE 7.0

View Tutorial          By: bangaram at 2011-07-19 12:03:04

2. @Brian rename the file name to match the class nam
View Tutorial          By: QuangQUang at 2015-09-27 14:44:37

3. Hello sir pls send me
com.sun.speech.freett

View Tutorial          By: shanthi at 2013-03-22 11:18:56

4. Very Easy To Understand
View Tutorial          By: Najeeb at 2011-06-09 04:12:34

5. Ask to google.
View Tutorial          By: John at 2013-05-03 22:58:23

6. hello,
i have completed my bsc(computer sci

View Tutorial          By: Geeta at 2012-07-25 13:35:07

7. "For example, float can be useful when repres
View Tutorial          By: rangzen at 2014-03-28 09:31:47

8. how to trim in jsp page and to send the trimed con
View Tutorial          By: monishaa at 2015-07-16 10:06:11

9. Is there any way to show the dynamic bean value in
View Tutorial          By: Bala at 2008-05-04 01:40:18

10. great material for language
View Tutorial          By: hafiz at 2015-03-24 12:18:45