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. thanku this is very good example
View Tutorial          By: priyanka at 2012-10-02 13:08:49

2. I do my projest in j2me.so please send me your ide
View Tutorial          By: sivasakthivel.s at 2011-06-22 13:26:54

3. How i can comment in server?Some another message
View Tutorial          By: Youjizz at 2013-04-09 00:30:47

4. Hi Shreya, in Linux, the COM ports are identified
View Tutorial          By: Ramlak at 2008-06-23 03:34:11

5. Hi Andi, Stig and Derick!

Nice tur

View Tutorial          By: Lasse Christiansen at 2010-05-01 01:58:14

6. really this introduction makes me very interesting
View Tutorial          By: Himaja Reddy at 2012-11-09 06:57:31

7. It is nice...
View Tutorial          By: Bunty at 2011-02-20 23:43:53

8. i want to need SCJD Dums. so please help me that w
View Tutorial          By: Dayamay singh at 2009-01-03 00:07:06

9. Excellent explanation...Thanku.
View Tutorial          By: Rajpal Singh at 2012-12-29 05:36:20

10. Thank you very much!!!

But I have t

View Tutorial          By: Gemis at 2009-04-14 02:37:08