title: How to sort a concurrent collection in .NET 4.0
body: <p>How to sort a concurrent collection in .NET 4.0
  For example I have constructed my ConcurrentBag collection. How can I sort the elements in it?</p>
  
  <pre class="lang-cs prettyprint-override"><code>ConcurrentBag&lt;string&gt; stringCollection;
  
  ConcurrentBag&lt;CustomType&gt; customCollection;
  </code></pre>