title: Is multi-level ConcurrentDictionary still thread-safe?
body: <p>I have four level data structure defined like this:</p>
  
  <pre><code>Dictionary&lt;Type1, Dictionary&lt;Type2, Dictionary&lt;Type3, List&lt;Type4&gt;&gt;&gt;&gt;
  </code></pre>
  
  <p>The whole thing is encapsulated in a class which also maintains thread-safety. Currently it just locks whole collection while it reads/manipulates the data (reading is by orders of magnitude more common than writing).</p>
  
  <p>I was thinking of replacing the <code>Dictionary</code> with <a href="http://msdn.microsoft.com/en-us/library/dd287191.aspx" rel="nofollow"><code>ConcurrentDictionary</code></a> and <code>List</code> with <a href="http://msdn.microsoft.com/en-us/library/dd381779.aspx" rel="nofollow"><code>ConcurrentBag</code></a> (its items don't have to be ordered).</p>
  
  <p>If I do so, can I just eliminate the locks and be sure the concurrent collections will do their job correctly? </p>