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



Ask a Question

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. We migrated to office365 this morning and i was ab
View Tutorial          By: Muthukumaran at 2012-09-01 08:37:27

2. Not bad,but need some implementation
View Tutorial          By: surjeet katwal at 2010-01-19 04:41:15

3. Awesome code workings fro me thank you so much :)
View Tutorial          By: Shripad at 2012-01-24 08:58:03

4. Hi,
i am using crystal report 9. Once i ins

View Tutorial          By: jeff at 2012-02-12 08:14:15

5. i cannot add attachment
its saying
&

View Tutorial          By: Rintu Das at 2012-05-04 18:07:48

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

7. how to java program run in system and how to open
View Tutorial          By: safeek at 2012-10-20 06:54:38

8. @All

You need to first keep your .w

View Tutorial          By: Nithya at 2011-08-31 02:27:48

9. Thanks for the information.
View Tutorial          By: Appala Naidu at 2012-02-10 09:11:29

10. @3
argc simply means the argument count.
View Tutorial          By: CDub at 2010-02-22 09:32:54