File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes join vs wait/notify Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "join vs wait/notify" Watch "join vs wait/notify" New topic
Author

join vs wait/notify

Laiq Ahmed
Ranch Hand

Joined: Jan 04, 2010
Posts: 44
Please comment on my following understanding:

In context of threading, I am confused about join() and wait-notify mechanism. I believe both are used to halt one thread (say ThreadA)
so the other thread (say ThreadB)can finish the job. Assume ThreadB is a pre condition for ThreadA. In this case we may use threadBObj.join();
from threadAObj executing code or we may use wait/notify mechanism. wait/notify requires synchronization blocks so I would say that might
complicate things.
Minhaj Mehmood
Ranch Hand

Joined: Jan 22, 2007
Posts: 400

Laiq Ahmed wrote:Please comment on my following understanding:

In context of threading, I am confused about join() and wait-notify mechanism. I believe both are used to halt one thread (say ThreadA)
so the other thread (say ThreadB)can finish the job. Assume ThreadB is a pre condition for ThreadA. In this case we may use threadBObj.join();
from threadAObj executing code or we may use wait/notify mechanism. wait/notify requires synchronization blocks so I would say that might
complicate things.


check this.

hth.


SCJP6 96% | SCWCD5 81% | SCDJWS5 79%
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: join vs wait/notify