Im trying to figure out how to find out when all my threads
in the queue are done.. when they are done i want to display a MessageBox
saying something like "Operation completed".
This is the code i am using to queue my threads:
Smart.STPStartInfo stpStartInfo = new Smart.STPStartInfo();
stpStartInfo.MaxWorkerThreads = Convert.ToInt32(numericUpDown5.Value);
stpStartInfo.MinWorkerThreads = 2;
_smartThreadPool = new Smart.SmartThreadPool(stpStartInfo);
foreach (string item in urlQueue)
{
_smartThreadPool.QueueWorkItem(
new Amib.Threading.Func<string, int, int, string, int>(checkURLSmart),
item, iia, 5000, kryptonTextBox1.Text);
iia++;
}
Any ideas how to know when all threads have completed their work?