• Post Reply Bookmark Topic Watch Topic
  • New Topic

Making thread program  RSS feed

 
Richard Teston
Ranch Hand
Posts: 89
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I'm having a hard time making this thread program:
I have 5 threads that searches to different data sources. I want to wait for them all to finish before intergrating them together. How will I implement this? Please help. Thanks
 
Paul Clapham
Sheriff
Posts: 22374
42
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
To wait for a thread to finish, you simply call its join() method. So your code to wait for all of them to finish might look like this:
 
Richard Teston
Ranch Hand
Posts: 89
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you Paul for the response, it worked.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!