You mean an array of threads?
My first suggestion is always to look at the ThreadPool class in the
System.Threading namespace. If that won't suit your needs, perhaps you
are trying to do something like the following?
static void Main(string[] args)
{
Thread[] threads = new Thread[5];
for(int i = 0; i < threads.Length; i++)
{
threads[i] = new Thread(new ThreadStart(DoWork));
}
for(int i = 0; i < threads.Length; i++)
{
threads[i].Start();
}
for(int i = 0; i < threads.Length; i++)
{
threads[i].Join();
}
Console.WriteLine("Complete");
}
static void DoWork()
{
Console.WriteLine("DoWork");
}
HTH,
--
Scott
http://www.OdeToCode.com
On Mon, 12 Apr 2004 19:17:10 -0300, "Ricardo" <dr*******@terra.com.br>
wrote:
how can I create and use a thread array???