Chad,
As Mikey pointed out, the thread pool I recommended was the system one.
Also, there is something to manage. You have to manage the instances of the
Thread class yourself, and also set up some mechanism for notification when
the thread is done (if it is needed).
You are right, at five threads, it should be no problem (given normal
conditions). However, the OP indicated that they wanted to create x number
of threads at a time. I have interpreted x to be anywhere from one to
positive infinity, which can be a very, very large number. If the number
falls somewhere in the lower end of that range, then I think the ThreadPool
is the best solution, and agree with Mikey's remarks about why you would
create specific thread instances.
You also get a perf advantage as well, which can be important when
trying to manage that many threads. The thread pool will save you the time
normally dedicated to the initialization and teardown of the thread, which
is something you can not avoid easily by creating and managing your own
threads.
--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)
Chad Z. Hower aka Kudzu said:
"Mickey Williams" <my first name at servergeek.com> wrote in
In almost all cases that a threading novice encounters, explicit thread
management is pain for no gain.
There isnt anything to manage, create, start, destroy. Unless you have a
bunch of worker threads that are all instances of the same thread class.
--
Chad Z. Hower (a.k.a. Kudzu) -
http://www.hower.org/Kudzu/
"Programming is an art form that fights back"
ELKNews - Get your free copy at
http://www.atozedsoftware.com