• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Knute Snortum
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Ron McLeod
  • Piet Souris
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Frits Walraven
  • Ganesh Patekar

wait and notify problem from K&B.

 
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


Dear Friends
i am not understanding that when i am commenting notify() still why i am getting total in main ThreadA .please explain me.
Thanking You.
 
author
Posts: 23836
140
jQuery Eclipse IDE Firefox Browser VI Editor C++ Chrome Java Linux Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Unfortunately, what you are seeing is an implementation detail of the join() method... I explained it a couple of times before. It may be worth it to search the forums...

Here is one of those times...

http://www.coderanch.com/t/234368/Threads-Synchronization/wait-without-notify

Hope this helps,
Henry
 
aruna dabas
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i got it ,,,Thanks Henry
 
Ranch Hand
Posts: 67
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm sorry guys. But now I'm a little bit confused.

For me these examples of "wait without notify" just work in the same way as using the join() method. I'm just waiting for a thread to die.

Am I missing something here?
 
Sheriff
Posts: 9643
42
Android Google Web Toolkit Hibernate IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Rafael you are right that this works like waiting for a thread to die. But this depends on the internal implementation of the Thread class. So this will not be tested in SCJP...
 
Rafael Angarita
Ranch Hand
Posts: 67
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you very much!
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!