Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

working of join() methord in Thread  RSS feed

 
Gaurav Chhabras
Ranch Hand
Posts: 126
  • 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
  • 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
  • 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 ]
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!