title: Is ReadOnlyCollection threadsafe if the underlying collection is not touched?
body: <p><a href="http://msdn.microsoft.com/en-us/library/ms132474%28VS.80%29.aspx" rel="noreferrer">MSDN</a> vaguely mentions:</p>
  
  <blockquote>
    <p>A ReadOnlyCollection&lt;(Of &lt;(T>)>) can support multiple readers concurrently, as long as the collection is not modified. <i>Even so, enumerating through a collection is intrinsically not a thread-safe procedure</i>. To guarantee thread safety during enumeration, you can lock the collection during the entire enumeration. To allow the collection to be accessed by multiple threads for reading and writing, you must implement your own synchronization.</p>
  </blockquote>
  
  <p>Would the following public static collection be safe for multiple threads to iterate over?  If not, is there something built into .NET that is safe?  Should I just drop the <code>ReadOnlyCollection</code> and create a new copy of a private collection for each access of a SomeStrings property getter?  I understand that there could be a deadlock issue if multiple threads tried to lock on the public collection, but this is an internal library, and I can't see why we would ever want to.</p>
  
  <pre><code>public static class WellKnownStrings {
  
      public static readonly ICollection&lt;string&gt; SomeStrings;
  
      static WellKnownStrings()
      {
          Collection&lt;string&gt; someStrings = new Collection&lt;string&gt;();
          someStrings.Add("string1");
          someStrings.Add("string2");
          SomeStrings = new ReadOnlyCollection&lt;string&gt;(someStrings);
      }
  }
  </code></pre>