If you're looking for one thread to wait for the other two to complete, the fork/join pattern would work:
Thread thread1 = new Thread(new ThreadStart(ThreadEntry)); Thread thread2 = new Thread(new ThreadStart(ThreadEntry)); thread1.Start(); thread2.Start(); thread1.Join(); thread2.Join(); //current thread won't get here until both thread1 and thread two have completed. If you're running some background threads in order to keep your UI responsive, then using a BackgroundWorker may be more appropriate. It sends a completed event back to the thread that created the BackgroundWorker when the asynchronous work has completed. You can simply check to see that both BackgroundWorkers have completed before moving on to whatever is dependent on that work... On Wed, 24 Oct 2007 11:10:34 -0400, Knowlton, Gerald F. <[EMAIL PROTECTED]> wrote: >Greetings: > > I'm looking for a way for a thread to invoke a method in an >application when the thread has fully completed the tasks assigned to >it. Seems to me I sorta remember a way it was done in VS2005 using >"delgates" ??? > >So to be clear, I do not want to have a call to another method within a >method that is in the thread, rather when Method X has exited, then the >thread does "clean up or signaling work " in Method Y. > >The reason for this request is because I have an application that has >multiple threads running which sometime thread X finishes before thread >Y or just the opposite and thread Z shouldn't start until both X and Y >are done. > >Thanks for any assistance you can provide. > > >Best regards, > > >Jerry Knowlton > >=================================== >This list is hosted by DevelopMentorĀ® http://www.develop.com > >View archives and manage your subscription(s) at http://discuss.develop.com =================================== This list is hosted by DevelopMentorĀ® http://www.develop.com View archives and manage your subscription(s) at http://discuss.develop.com