ThreadPool to perform 70 processes

Jan 18 2006 6:26 AM

I am using the following code below and i have set max threads to 10 in the threadpool and it stops after 8 i values.How to make it execute upto 70 iterations.


WaitCallback callBack
= new WaitCallback(UploadFileEx0);
for(int i = 0; i < 70; i++)
{
        if(true == isThreadAvailable(true))
      {
         ThreadPool.QueueUserWorkItem(callBack,GetFileName(this.listView1.Items[i].ToString()));
      }
        else
      {
         MessageBox.Show("Worker thread not available ");
      }
}