Solved

Is threading a good option?

Posted on 2006-07-21
3
288 Views
Last Modified: 2010-04-16
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
0
Comment
Question by:matt_d_p
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 23

Accepted Solution

by:
apresto earned 125 total points
ID: 17154211
Hi matt_d_p,

Threading is good, but can be dangerous if you dont use it properly.  For exampe, if 2 threads are accessinf the same file - i dont think its going to like that, however with threading you can Queue processes.  You can use threading to run multiple processes at once, i.e you may have one thread talking and retrieving info from the database, and you might have another thread sending that information somewhere, acting as a data router

Threading is extremely useful, but do some serious reading before you commit to code

Apresto
0
 
LVL 35

Expert Comment

by:mrichmon
ID: 17154598
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
0
 

Author Comment

by:matt_d_p
ID: 17154603
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.
0

Featured Post

Ready to get started with anonymous questions?

It's easy! Check out this step-by-step guide for asking an anonymous question on Experts Exchange.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article series is supposed to shed some light on the use of IDisposable and objects that inherit from it. In essence, a more apt title for this article would be: using (IDisposable) {}. I’m just not sure how many people would ge…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …

636 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question