title: ConcurrentHashMap needed with ReadWriteLock?
body: <p>I have a <code>Map</code> which is read by multiple threads but which is (from time to time) cleared and rebuilt by another thread.</p>
  
  <p>I have surrounded all the access to this map with </p>
  
  <pre><code>readWriteLock.readLock().lock()
  try {
    ... access myMap here...
  } finally {
    readWriteLock.readLock().unlock()
  }
  </code></pre>
  
  <p>... or the <code>writeLock()</code> equivalents, depending on the type of access.</p>
  
  <p>My question is... will the <code>ReadWriteLock</code> ensure the updates to <code>myMap</code> are visible to the other threads (since they must wait until after the <code>unlock()</code> is called by the writing thread?  Or, do I also need to make <code>myMap</code> a concurrent map, like <code>ConcurrentHashMap</code>?  </p>
  
  <p>I will probably do that, just to be safe, but I'd like to understand better.</p>