The Join method blocks the calling thread until the specified thread exits. If your application creates multiple threads, then join the threads together and wait for all the threads to end before continuing your processing. The myPendingJob class would accept the arguments required for running the job. Each thread worker in myPendingJobThread processes its instance of myPendingJob.
This example below provides a simple scenario without any scheduling or handling beyond "fire and forget" threading. HTH! Kara Thread[] myPendingJobThread = {new Thread(new myPendingJob(myPendingJobArgs)), new Thread(new myPendingJob(myPendingJobArgs)) };
Public void DoSomething() { Foreach (Thread jobThread in myPendingJobThread) {
myThread.IsBackground = true; myThread.Start(); } Foreach(Thread jobThread in myPendingJobThread) { jobThread.Join(); } =================================== This list is hosted by DevelopMentorĀ® http://www.develop.com View archives and manage your subscription(s) at http://discuss.develop.com