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. Where should the file be placed? How do I know wh
View Tutorial          By: Anon at 2009-07-23 14:08:17

2. ASNWERING: what's the purpose of indexOf('t',10)
View Tutorial          By: Kyle at 2012-03-22 09:17:04

3. thanks bro it worked for me ....keep it up.
View Tutorial          By: azhar at 2010-12-27 00:44:36

4. package practice_bo;

import practic

View Tutorial          By: nishi at 2011-12-09 02:00:20

5. hey Mounika..did u solve ur problem ??if u did ple
View Tutorial          By: agnas at 2008-04-28 23:59:37

6. I have got "time out at step 6". How can
View Tutorial          By: MCHON at 2008-10-05 12:36:42

7. Hi can anyone help me out, i need a full jsp code
View Tutorial          By: thangaraj at 2007-03-20 12:40:05

8. i have run the code successfully but it does not s
View Tutorial          By: amrish at 2010-12-11 07:00:28

9. Thank you very much for explaning the things in su
View Tutorial          By: Sunil Yadav at 2010-05-27 04:04:31

10. Declaring int result within the method will change
View Tutorial          By: Soph at 2013-02-06 06:11:39