I have a console application that inits 4 theads to perform a long task. I want my program to wait until the threads are complete, and then complete the program execution. Is there a way to stop the program from executing, letting the threads complete their job?
+14
A:
Threading.Thread.Join is what you are looking for.
Edit: Examples here
Pondidum
2009-04-29 13:58:19
+1
A:
Depending upon how you're starting the 4 threads then WaitHandle.WaitAll might be a good place to start...
Martin Peck
2009-04-29 13:59:05
+2
A:
Load your application after those threads are joined e.g:
Thread1.join();
Thread2.join();
Thread3.join();
Thread4.join();
startApplication();
If you could provide me in more detail i can help you better.
Aizaz
2009-11-02 09:32:51