This week's book giveaway is in the OCAJP 8 forum.
We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line!
See this thread for details.
The moose likes Threads and Synchronization and the fly likes running two process concurrently and store it in separate objects Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 forum!
JavaRanch » Java Forums » Java » Threads and Synchronization
Bookmark "running two process concurrently and store it in separate objects" Watch "running two process concurrently and store it in separate objects" New topic
Author

running two process concurrently and store it in separate objects

vinoth muthuswamy
Greenhorn

Joined: May 24, 2011
Posts: 4
Hi,
I am new to java Thread concept.i want to read two xml files concurrently by hitting both URLs(the xml files in the URL) and store it

in two different objects.After completion of the URL reading i need to hit another URL to reset the site.Can any one give me the sample

code.....


Thanks in advance,
Stephan van Hulst
Bartender

Joined: Sep 20, 2010
Posts: 4112
    
  19

Hi Vinoth, welcome to CodeRanch.

You can use an ExecutorService to handle any amount of tasks that you want, and then wait until they are done before you continue. It would look roughly like this:


The mind is a strange and wonderful thing. I'm not sure that it will ever be able to figure itself out, everything else, maybe. From the atom to the universe, everything, except itself.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: running two process concurrently and store it in separate objects
 
It's not a secret anymore!