title: c# running multiple process.Start() asynchronously
body: <p>I have a folder containing multiple PCL files which need converting to PDF. I am able to achieve this using a third party exe. To speed this up I am trying to run multiple Tasks(), each which starts a new System.Diagnostics.Process using the exe;</p>
  
  <pre><code>System.Diagnostics.Process process = new System.Diagnostics.Process();
              process.StartInfo.FileName = $@".\WinPCLtoPDF\WinPCLtoPDF.exe";
              process.StartInfo.Arguments = $@"{StepParameters["StagingFileName"]} {StepParameters["StagingFileName"]}.pdf batch";
              process.Start();
              process.WaitForExit();
  </code></pre>
  
  <p>The tasks are added to a <code>List&lt;Task&gt;</code> and each is awaited before the program exits.</p>
  
  <pre><code>            foreach (FileInfo fileInfo in files)
              {
                  tasks.Add(ProcessDocumentTaskAsync(batchType, fileInfo, deleteOriginalFile));
  
                  while (tasks.Count &lt; files.Count() &amp;&amp; tasks.Where(x =&gt; !x.IsCompleted).Count() &gt; concurrentTasks)
                  {
                      Thread.Sleep(50);
                  }
              }
  </code></pre>
  
  <p>The Tasks are created using a method like this.</p>
  
  <pre><code>        private async static Task ProcessDocumentTaskAsync(BatchType batchType, FileInfo fileInfo, bool deleteOriginalFile)
          {
              await Task.Run(() =&gt;
              {   
                  ProcessParameters processParameters = ProcessParams();/////get process params            
                  DocumentProcessor documentProcessor = GetDocumentProcessor(batchType, processParameters);
                  using (documentProcessor)
                  {
                      documentProcessor.ProcessDocument();
                  }
              });
          }
  </code></pre>
  
  <p>This pattern works for other tasks and you can see from a log file that jobs are being performed asynchronously. However, with this WinPCLtoPDF.exe, it appears to only process one file at a time, yet the task manager shows there are multiple processes running. Process 1 &amp; 2 for example will wait, while 3 starts and finishes and is replaced by 4, 5 etc, until finally the whole folder is process and 1 then 2 complete.</p>
  
  <p>Can I find out why 1 &amp; 2 are appear to be being blocked and do not complete quickly, allowing other tasks to start?</p>