title: BackgroundWorkers never stop being busy
body: <pre><code>for (do it a bunch of times)
  {         
      while (backgroundWorker1.IsBusy &amp;&amp; backgroundWorker2.IsBusy &amp;&amp;
             backgroundWorker3.IsBusy &amp;&amp; backgroundWorker4.IsBusy &amp;&amp;
             backgroundWorker5.IsBusy)
      {
          System.Threading.Thread.Sleep(0001);
      }
  
      if (!backgroundWorker1.IsBusy)
      {
          backgroundWorker1.RunWorkerAsync();
      }
      else if (!backgroundWorker2.IsBusy)
      {
          backgroundWorker2.RunWorkerAsync();
      }
      else if (!backgroundWorker3.IsBusy)
      {
          backgroundWorker3.RunWorkerAsync();
      }
      else if (!backgroundWorker4.IsBusy)
      {
          backgroundWorker4.RunWorkerAsync();
      }
      else if (!backgroundWorker5.IsBusy)
      {
          backgroundWorker5.RunWorkerAsync();
      }
  }
  </code></pre>
  <p>it runs five times (every BG-worker once) and gets stuck in the while. Don't the backgroundworkers ever stop being busy ? how do I check availability ?</p>
  <p>note: there are 5 worker threads, this assures none of them is ever stopped, always assigning work to them. But they refuse to tell me when they are available, I thought that would have a simple solution..</p>
  <p>--[edit request]---</p>
  <p>Actually it was only a dummy parameter, i removed it and forgot to get it out, I only use it to call the dowork, who does the dirty job:</p>
  <pre><code>private void backgroundWorker1_DoWork(object sender, DoWorkEventArgs e)
  {
      timeconsumingfunction(publicstring);
  }
  </code></pre>
  <p>And the timeconsumingfunction DOES end. stepping into it in the debugger and running line per line, it goes until the end and arrives in the final '}'. That means it ends, right ?</p>