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. nice tutorial,but if provided with the complete ex
View Tutorial          By: Prasant Kumar Sahu at 2013-01-07 13:17:20

2. is this code applicable if I used USB GSM Modem? a
View Tutorial          By: Rania at 2010-09-14 12:33:15

3. Dude, you made my day.
View Tutorial          By: Sebasti├ín at 2011-08-29 14:01:10

4. good information
View Tutorial          By: varun at 2013-01-04 14:51:19

5. good one
View Tutorial          By: yogesh at 2010-07-24 21:18:24

6. Enough to understand basic concept.Thanks.
View Tutorial          By: Jyothylakshmy P u at 2012-09-18 05:35:48

7. sir the program is
error: error reading C:

View Tutorial          By: Yashovardhan at 2008-05-05 21:42:27

8. I can not understand left shift operater ,i am a f
View Tutorial          By: umar at 2012-01-31 12:28:11

9. There is a major bug here. When i press backspace
View Tutorial          By: Rajasri at 2015-01-20 10:11:30

10. thank you. it was very useful.
View Tutorial          By: ravindar at 2009-01-09 01:04:15