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. i appreciate the article for being straight to the
View Tutorial          By: shey-poun at 2011-12-14 06:39:51

2. Very good
View Tutorial          By: take at 2010-03-29 07:47:01

3. Can u send total code, i am in critical position n
View Tutorial          By: ram at 2011-05-16 07:07:10

4. Hi,it's really nice to see all the comments of the
View Tutorial          By: sraban at 2011-10-13 12:13:38

5. i have to write a calculator program for very ve
View Tutorial          By: maryam at 2012-12-31 10:21:55

6. Very nice article.... explained the concept very n
View Tutorial          By: prashant yeole at 2010-12-16 03:15:07

7. I was trying to copy your coding and execute it, b
View Tutorial          By: Guest at 2012-01-02 04:08:21

8. it is 3 days since I searched resolution. It was h
View Tutorial          By: Daniel Costa at 2009-02-25 06:11:27

9. please send me Java programs
View Tutorial          By: Jayita at 2009-11-06 08:19:59

10. this is WRONG!

your IF should be:
View Tutorial          By: notnooblikeyou at 2013-01-29 15:11:30