title: Parallel compression folder, best solution in c#
body: <p>I need to compress more folder at same time in different archivie to goes more quikly. 
  I tried to use a main backgroundworker and from this I did a for cycle to start other backgroundworker for each folder. I notice that the backgroundworker starts all at same time but not works together what is the best way to do a parallel archive?what you suggest?
  to create the archive I use the zipforge library</p>
  
  <pre><code>DoWork of the main backgroundworker
  if (Directory.Exists(destination))
          {
              if (MessageBox.Show("", MessageBoxButton.YesNo, MessageBoxImage.Question) == MessageBoxResult.No)
              {
                  goto EXIT_UTENTE;
              }
              else
              {
                  bool finish = false;
                  int j = 1;
  
                  string dest_appoggio = destination;
  
                  do
                  {
                      dest_appoggio = destination + "_" + j;
  
                      if (Directory.Exists(dest_appoggio))
                      {
                          j++;
                      }
                      else
                      {
                          destination = dest_appoggio;
                          dataprogressiva = data + "_" + j;
                          finish = true;
                      }
                  }
                  while (finish == false);
              }
          }
  
          destinationdefault = destination;
  
          var row_list1 = GetDataGridRows(dgwRobot);
  
          int riga = -1;
  
          foreach (DataGridRow single_row1 in row_list1)
          {
              bool rowselected = false;
              single_row1.Dispatcher.Invoke(new Action(() =&gt; { rowselected = single_row1.IsSelected; }));
  
  
              if (rowselected == true)
              {
                  riga = single_row1.GetIndex();
                  var robotProcessed = false;
  
                  while (!robotProcessed)
                  {
                      for (var threadNum = 0; threadNum &lt; MaxBackupContemporanei; threadNum++)
                      {
                          if (!threadArray[threadNum].IsBusy)
                          {
                              threadArray[threadNum].RunWorkerAsync(riga);
  
                              robotProcessed = true;
  
                              break;
                          }
                      }
                  }
              }
              Thread.Sleep(500);
          }
  
          bool bwTerminati = false;
  
          while (!bwTerminati)
          {
              for (var threadNum = 0; threadNum &lt; MaxBackupContemporanei; threadNum++)
              {
                  if (threadArray[threadNum].IsBusy)
                  {
                      bwTerminati = false;
                      threadNum = MaxBackupContemporanei;
                  }
                  else
                  {
                      bwTerminati = true;
                  }
              }
          }
  </code></pre>