title: Should I lock a file before I read it in C#
body: <p>Do I need to lock an xml file in C# before I read it and if I am never writing back to that file. </p>
  
  <p>If I use, </p>
  
  <pre><code>   using(FileStream fileStream = new FileStream(
                  "myXmlFile.xml", 
                  FileMode.Open, 
                  FileAccess.Read, 
                  FileShare.Read))
  </code></pre>
  
  <p>is there any chance that in a multithreaded environment, two users can access the same file at the same time and get a lock error?</p>