This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Object's Lock Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Object Watch "Object New topic
Author

Object's Lock

Marcelo Ortega
Ranch Hand

Joined: May 31, 2005
Posts: 519


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!
janki tangeda
Ranch Hand

Joined: Jun 07, 2005
Posts: 54
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.
 
Consider Paul's rocket mass heater.
 
subject: Object's Lock
 
Similar Threads
please give me solution for below program
Synchronized Thread
Multithread program from khalid mughal
Use of Private Constructor in Thread Example
Thread.sleep