0

I have created threads dynamically.

static void Main(string[] args)
{
    int ThreadCount = Convert.ToInt32(ConfigurationManager.AppSettings["Threads"]);
    List<Thread> th = new List<Thread>();
    for (int i = 0; i < ThreadCount; i++)
    {
        Thread t = new Thread(print);
        th.Add(t);
    }
    foreach (Thread t in th)
    {
        t.Start();
    }
}

public void print()
{
    console.writeline("123");
}

I want to know when this threads will complete.
On completion of these threads i want to print a message of "DONE"

How can i do this.

2
Contributors
1
Reply
3
Views
5 Years
Discussion Span
Last Post by Momerath
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.