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. Dear admin,
your Recaptcha design is not go

View Tutorial          By: surendra kumar sharma at 2013-02-02 05:58:35

2. Very helpful!!
View Tutorial          By: mahesh at 2012-07-12 06:24:50

3. help me in my final project about arrays
View Tutorial          By: grace at 2013-03-13 09:54:11

4. XML Parsing - Simplified.
Thanks.

View Tutorial          By: Piyush at 2011-05-19 22:56:23

5. We migrated to office365 this morning and i was ab
View Tutorial          By: Muthukumaran at 2012-09-01 08:37:27

6. thank u very much...............
View Tutorial          By: naveen at 2011-07-05 06:00:04

7. Hi Sir,
Thank You so much for your

View Tutorial          By: kareena at 2010-10-21 23:26:37

8. This is very simple and easy to understand.

View Tutorial          By: satish at 2011-12-25 09:03:16

9. quite helpful
View Tutorial          By: kezyRoan at 2011-06-11 03:58:52

10. really good
View Tutorial          By: ammu at 2009-11-04 05:07:14