N
natebruneau
So I am new to the world of multi-threading. My multithreading
application works, however I want the application to run the commands
post-foreach loop after each thread has completed.
Lets say there are 10 threads. How can I create a wait after the
foreach loop?
foreach (testObject website in websites)
{
Thread th1 = new Thread(this.addToGrid);
th1.Start(website);
}
//Execute this after all threads have been completed
Console.WriteLine("Threads Completed");
application works, however I want the application to run the commands
post-foreach loop after each thread has completed.
Lets say there are 10 threads. How can I create a wait after the
foreach loop?
foreach (testObject website in websites)
{
Thread th1 = new Thread(this.addToGrid);
th1.Start(website);
}
//Execute this after all threads have been completed
Console.WriteLine("Threads Completed");