API Thread Safety

If you are having a problem using Vault, post a message here.

Moderator: SourceGear

Post Reply
silverbullet1972
Posts: 2
Joined: Mon Oct 09, 2006 11:32 am
Location: Scottsdale, AZ

API Thread Safety

Post by silverbullet1972 » Mon Oct 09, 2006 11:45 am

I am using the vault API to retrieve files, specifically using the ClientInstance.GetToNonWorkingFolder method. If I move through the folders within a single thread and execute this method for each of the files contained within a VaultClientFolder, all is well. However, if I thread out a VaultClientFolder and attempt to execute the method from x threads simultaneously, I receive a GetLatestVersionFailedException error. Unfortunately, I cannot change the HTTP Keep-Alives setting (per other topics on this error) as the site is shared. So, my main question is that if Vault/Vault API supports multiple threads in this scenario.

Thanks!

jclausius
Posts: 3706
Joined: Tue Dec 16, 2003 1:17 pm
Location: SourceGear
Contact:

Post by jclausius » Mon Oct 09, 2006 12:19 pm

The Vault API is already threaded for downloads. I believe 5 or 10 threads are used to download the files.

What you'll want to do is gather up as many GET requests in one batch and call them from within a single thread.
Jeff Clausius
SourceGear

silverbullet1972
Posts: 2
Joined: Mon Oct 09, 2006 11:32 am
Location: Scottsdale, AZ

Post by silverbullet1972 » Mon Oct 09, 2006 12:39 pm

Ok, I changed it to process a folder object instead of each individual file. It's a little faster than before within a single thread, however it's still not as fast as I was hoping. And threading out each folder and calling GetToNonWorkingFolder with that folder object (instead of indv. files) still causes the error. Guess I will have to live with it...

Thanks.

Post Reply