File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

working of join() methord in Thread

 
Gaurav Chhabras
Ranch Hand
Posts: 126
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
can someone please tell me the exact working of " join() " methord in Thread.

Thanks
Regards
Gaurav
 
Kris Krason
Greenhorn
Posts: 25
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This method waits until the thread (for which it was called) dies (ends its run() method)
 
Srinivasa Raghavan
Ranch Hand
Posts: 1228
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thread.join () method lets one thread to join to the end of other thread.
It will run only after the other thread completes the execution.

If a thread named 'x' cannot do it's work until other thread 'Y' completes then 'X' should join 'Y' Now X will run only after 'Y' completes it's work
[ October 14, 2005: Message edited by: Srinivasa Raghavan ]
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic