Link to home
Start Free TrialLog in
Avatar of matt_d_p
matt_d_p

asked on

Is threading a good option?

Hi

My problem:

I need to connect to a bunch of computers (4000) and execute a batch file. Because these computers are in use I have a limited window in which to accomplish this. My idea is to use a threadpool with each thread making a remote connection and executing the batch file in order to improve the time to complete. Will threading improve my time to complete. I will probably use the WMI Win32_process.create method to run the batch file.

Target computers: WinXP without .NET

Matt
ASKER CERTIFIED SOLUTION
Avatar of apresto
apresto
Flag of Italy image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of mrichmon
mrichmon

Threading benefits can be seen more on computers with multi processors.  If the target machines don't have multiple processors, then you may not see very much benefit and therefore it may not be worth the overhead.

A good book that discusses threading is:

C# Threading Handbook by Wrox ISBN: 1861008295
Avatar of matt_d_p

ASKER

Thanks Apresto

My thread will be working on a seperate remote machine in each case so I don't need to worry about syncronization or anything like that. I'm hoping that running multiple threads will reduce my time as I think a lot of the single process time is spent waiting on the network.

the only place I might have to be careful is I'd like to output the machine name to a text file for record purposes but I think I can use the built in delegate for that.