title: Is ReaderWriterLockSlim the right choice?
body: <p>I'm writing a global error handler/logger for applications running in Windows Azure. When an error occurs in the application, a number of operations are performed that need to happen atomically. I need to prevent an error from being logged until the previous one has completed. Meanwhile, I want reads of the logs to occur as needed.</p>
  
  <p>My initial thought was using a Monitor/lock and lock only the error writes. That way the reads aren't inhibited at all. I was wondering though whether a ReaderWriterLockSlim would be more appropriate. I can't say I <em>truly</em> understand the value between one approach vs. the other. </p>
  
  <p>Should I create a ReaderWriterLockSlim and do something like the following below (with reads being wrapped in EnterReadLock)...</p>
  
  <pre><code>public static void LogError(Exception exception)
  {
      _lock.EnterWriteLock();
  
      ...
  
      _lock.ExitWriteLock();
  }
  </code></pre>
  
  <p>Or do I simply do something like the following, only locking the write sections:</p>
  
  <pre><code>public static void LogError(Exception exception)
  {
       lock (someStaticLock)
       {
          ...
       }
  }
  </code></pre>
  
  <p>Any thoughts/advice would be much appreciated.</p>