Are the notify() and wait() methods implemented correctly? I was expecting the output to be from 0 to 10 with no double nor numbers missing, but i am actually get doubles AND number missing... [ July 07, 2005: Message edited by: Barry Gaunt ]
SCJP 1.4, SCWCD 1.4, SCBCD 1.3, SCJD, SCEA/OCMJEA
Live life to an interface, not an implementation!
posted 10 years ago
I have just started reading on java threads and i have a question on the code you wrote.Don't we use wait() method to wait for some condition to be met.I don't see any such condition here.For e.g. in getValue() method, is it not required to check if the value is updated and wait until the updating is done.