I'm creating three threads in one of my application. The requirement I have is that the method that creates these three threads and starts them off should not return unless all these three threads are executed.
I tried to use Join on all three threads. However, I observe that when I use Join the total execution time of my method is the sum of execution times of all three threads. In other words they are getting executed in sequence.
I tried using ThreadState but realized from MSDN and stackoverflow that ThreadState property should only be used for debugging purposes and not for real coding.
What is the best way I can achieve this and keep the execution parallel.
Any ideas will be much appreciated. Thanks in advance