title: Practical use cases for ConcurrentHashMap
body: <p>I am not looking for differences among various data structures like <code>HashMap</code>, <code>Collections.synchronizedMap(Map)</code> or <code>HashTable</code>. <em>SO</em> is full of such posts. </p>
  
  <p>I also know that ConcurrentHashMap will not throw <code>ConcurrentModificationException</code> for reader thread if another writer thread modifies the map. </p>
  
  <p>What I am looking for about practical scenarios when a reader thread can afford to work on <strong>stale data</strong>?<br>
  i.e. lets say thread-1 gets an <code>Iterator</code> at time T1 in a thread then at later time T2 , an element is inserted to map by another thread thread-2. <code>ConcurrentHashMap</code> says that thread-1 is not guaranteed to see updated data so I guess it keeps iterating over stale data. </p>
  
  <p>Can anybody point me to concrete problems where this might be considered OK? like in implementing cache, multi threaded web services etc or problems from your own practical experience??</p>
  
  <p>All the problems that I encountered always required updated view of data since that was the whole purpose of inserting data to a map so readers can work on updated data, alternatively, what were the problems where a synchronized map not a good fit?</p>
  
  <p>In theory all looks good but my curiosity arose since I never encountered any such scenario in my day job where readers could afford to work on stale view. </p>