Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Object's Lock

 
Marcelo Ortega
Ranch Hand
Posts: 528
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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 ]
 
janki tangeda
Ranch Hand
Posts: 54
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic