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 want to know about all java application.
View Tutorial          By: Ahasan at 2009-04-10 09:42:48

2. Basic Example to undestand java literal persons
View Tutorial          By: Sajid mestri (maha,sangli) at 2010-10-30 00:44:44

3. Dear All, I am getting the following exception for
View Tutorial          By: Protik Basu at 2008-10-31 05:30:36

4. thanq for this tutorial. It is very useful. But i'
View Tutorial          By: syahmi at 2010-03-06 02:55:05

5. good
View Tutorial          By: dock at 2013-06-07 15:18:49

6. what are the basic requirements to send sms from p
View Tutorial          By: kanagarajan at 2008-01-02 07:52:44

7. Thank you! This article helped me to solve this pr
View Tutorial          By: Stan Devyatovsky at 2008-09-12 05:20:20

8. excellent explanation...............Thanks for mak
View Tutorial          By: Kiran Leo at 2012-12-08 06:41:26

9. Please resolve this problems :

ja

View Tutorial          By: madhusudhakar at 2014-10-24 06:11:10

10. it is possible to write any synchronisation progra
View Tutorial          By: shashi kant mishra at 2013-10-14 02:54:25