title: Csharp threading starting new threads when one finished without waiting on join
body: <p>I've searched all morning and I can't seem to find the answer to this question. </p>
  
  <p>I have an array of Threads each doing work and then I'll loop through the ids joining each one then starting new threads. What's the best way to detect when a thread has finish so I can fire off a new thread without waiting for each thread to finish?</p>
  
  <p>EDIT added code snippet maybe this will help</p>
  
  <pre><code>            if (threadCount &gt; maxItems)
              {
                  threadCount = maxItems;
              }
  
              threads = new Thread[threadCount];
  
              for (int i = 0; i &lt; threadCount; i++)
              {
                  threads[i] = new Thread(delegate() { this.StartThread(); });
                  threads[i].Start();
              }
  
              while (loopCounter &lt; threadCount)
              {
                  if (loopCounter == (threadCount - 1))
                  {
                       loopCounter = 0;
                  }
  
                  if (threads[loopCounter].ThreadState == ThreadState.Stopped)
                  {
                      threads[loopCounter] = new Thread(delegate() { this.StartThread(); });
                      threads[loopCounter].Start();
                  }
  
              }
  </code></pre>