title: Can one iterate a dictionary being modified by another thread without raising exceptions?
body: <p>I have a dictionary being updated by one thread, and in another thread I'd like to iterate over its values.  Normally I'd use a lock, but this code is very performance-critical, and I want to avoid that if at all possible.</p>
  
  <p>A special feature of my case is that I don't care about absolute correctness of the iterator; if it misses entries that were removed after iteration started, or picks up ones added afterwards, that's fine.  I only require that it doesn't raise any sort of 'dictionary size changed during iteration' exception.</p>
  
  <p>Given this relaxed constraint on correctness, is there an efficient way to iterate the dictionary without using a lock?</p>
  
  <p>Note: I'm aware that <code>keys()</code> is threadsafe in Python 2.x, but since that behavior has changed in 3.x, I want to avoid it.</p>