title: List<T>.RemoveAll as parallel
body: <p>I would like to known an alternative to do a <code>toProcess.RemoveAll</code>, but in parallel. Today my code like my exemplo is working well, but in sequencial, and I'd like to be in paralle.</p>
  
  <pre class="lang-cs prettyprint-override"><code>using System;
  using System.Collections.Generic;
  using System.Linq;
  using System.Text;
  
  namespace ParallelTest
  {
      using System.Threading;
      using System.Threading.Tasks;
      class Program
      {
          static void Main(string[] args)
          {
              List&lt;VerifySomethingFromInternet&gt; foo = new List&lt;VerifySomethingFromInternet&gt;();
              foo.Add(new VerifySomethingFromInternet(@"id1", true));
              foo.Add(new VerifySomethingFromInternet(@"id2", false));
              foo.Add(new VerifySomethingFromInternet(@"id3", true));
              foo.Add(new VerifySomethingFromInternet(@"id4", false));
              foo.Add(new VerifySomethingFromInternet(@"id5", true));
              foo.Add(new VerifySomethingFromInternet(@"id6", false));
  
              DoSomethingFromIntert bar = new DoSomethingFromIntert();
  
              bar.DoesWork(foo);
              Console.ReadLine();
          }
      }
  
      public class DoSomethingFromIntert
      {
          bool RemoveIFTrueFromInternet(VerifySomethingFromInternet vsfi)
          {
              Console.WriteLine(String.Format("Identification : {0} - Thread : {1}", vsfi.Identification, Thread.CurrentThread.ManagedThreadId));
              // Do some blocking work at internet
              return vsfi.IsRemovable;
          }
  
          public void DoesWork(List&lt;VerifySomethingFromInternet&gt; toProcess)
          {
              Console.WriteLine(String.Format("total : {0}", toProcess.Count));
              //Remove all true return
              toProcess.RemoveAll(f =&gt; this.RemoveIFTrueFromInternet(f));
              Console.WriteLine(String.Format("total : {0}", toProcess.Count));
          }
      }
      public class VerifySomethingFromInternet
      {
          public VerifySomethingFromInternet(string id, bool remove)
          {
              this.Identification = id;
              this.IsRemovable = remove;
          }
          public string Identification { get; set; }
          public bool IsRemovable { get; set; }
      }
  }
  </code></pre>