aspose file tools*
The moose likes IDEs, Version Control and other tools and the fly likes Multi-threaded svn checkout Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » IDEs, Version Control and other tools
Bookmark "Multi-threaded svn checkout" Watch "Multi-threaded svn checkout" New topic
Author

Multi-threaded svn checkout

jaibhim max
Greenhorn

Joined: Nov 15, 2010
Posts: 21
Hi All,

I have a huge code base in svn, which consists around 10 folders under "src" directory. i.e src/1, src/2, ..... , src/10. If I checkout the only "src" folder then the checkout is serial and it takes much time. So, I have decided to do a multiple checkout of all folders at same time using multi threading....So , I have created 10 threads and fired "svn" command for each folder. But the thing is when I checked process status, then it puts my 10 threads on very low priority and increases the time for checkout. It took around 1 hour.

Now, as an alternative I opened 10 terminals and fired "svn" checkout command on each terminal for each folder. Results were astonishing, it all happened in 15 mins. Is there a way by which i can achieve the same result through multi-threaded approach I used as mentioned in above paragraph.

-jai
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 38793
    
  23
Too difficult a question for "beginning". Moving thread.
Dan Din
Greenhorn

Joined: Jun 06, 2011
Posts: 12
Hi Jai,
How are you creating 10 threads for launching the svn command?
jaibhim max
Greenhorn

Joined: Nov 15, 2010
Posts: 21
Hi Dan,

I create 10 threads in similar fashion as follows....
Thread t1 = new Thread(new Threader1());
t.start();

and run() is as follows-

run(){

commandToSVNCheckout()

}
Dan Din
Greenhorn

Joined: Jun 06, 2011
Posts: 12
The threads started by JVM can't compete with those started by an OS command.
+ i suppose that commandToSVNCheckout() it's done by a third library implementation + the overhead due to the Java thread management.

I had a similar issue, on Windows - i used "start svn checkout xxx" for having different window running. In my case, the disk access was a bottleneck.

Good luck,
D.
jaibhim max
Greenhorn

Joined: Nov 15, 2010
Posts: 21
Hi Dan,

Thanks for the pointer.... commandToSVNCheckout() has svn command to co a directory and nothing else....
Could you please explain " i used "start svn checkout xxx" for having different window running", I did not understand it completely.


Thanks,
jai
Dan Din
Greenhorn

Joined: Jun 06, 2011
Posts: 12
jaibhim max wrote:
Now, as an alternative I opened 10 terminals and fired "svn" checkout command on each terminal for each folder.


You can open a single cmd window and launch different thread with start command; so, instead svn co XXXXX, you do start svn co XXXXX.
You can create a little BAT file who launch these checkout with the "magic" start command.

Good luck,
D.
jaibhim max
Greenhorn

Joined: Nov 15, 2010
Posts: 21
Thanks Dan, I will try it out...
jaibhim max
Greenhorn

Joined: Nov 15, 2010
Posts: 21
the svn command that I m executing is -


Whats the modification required?


-jai
Dan Din
Greenhorn

Joined: Jun 06, 2011
Posts: 12

jaibhim max
Greenhorn

Joined: Nov 15, 2010
Posts: 21
Hi Dan,

what I have observed after running "top" command that my all "svn" processes got stuck in "pipewr" state. If I would be able to take out my svn processes from "pipewr" state then everything will work fine.

Regards,
jai
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Multi-threaded svn checkout