title: Some data missing while process with Parallel Invoke
body: <p>I write some code below :</p>
  
  <pre><code>_concurentModels = new ConcurrentQueue&lt;ScanOutletBarcodeModel&gt;();
  models.ToList().ForEach(m =&gt; _concurentModels.Enqueue(m));
  Parallel.Invoke(ProcessInParalel);
  
  private void ProcessInParalel()
  {
      Action[] actions;
  
      if (_concurentModels.Count &gt; 0)
      {
          actions = new Action[GlobalVariable.ProcessorCount];
          for (int i = 0; i &lt; GlobalVariable.ProcessorCount; i++)
          {
              actions[i] = (ThreadProcess);
          }
  
          Parallel.Invoke(actions);
      }
  
      Thread.Sleep(1000);
  }
  
  private void ThreadProcess()
  {
     while (_concurentModels.TryDequeue(out model))
     {
         //proceed model
     } 
  }
  </code></pre>
  
  <p>when i set <code>GlobalVariable.ProcessorCount</code> = 16, the process is running correctly (all list of model processed) but if i increase processor count become above 20, some record of model seems missing and not processed. it's weird in my mind, Is increasing the thread makes some data lost? </p>
  
  <p>the reason that i increase processor count is because performance issue. Is anything wrong with my code? </p>
  
  <p>Thanks.</p>