• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Multi-threaded svn checkout

 
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Marshal
Posts: 79239
377
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Too difficult a question for "beginning". Moving thread.
 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Jai,
How are you creating 10 threads for launching the svn command?
 
jaibhim max
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Dan, I will try it out...
 
jaibhim max
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
the svn command that I m executing is -


Whats the modification required?


-jai
 
Dan Din
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

 
jaibhim max
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
reply
    Bookmark Topic Watch Topic
  • New Topic