title: C++ Are plain old array/vector/unordered_map thread safe when no resize/rehash happen?
body: <p>Suppose the size of these containers are fixed. The array, vector and unordered_map are fully initialized with all indexes/keys possible in our setting before concurrent use.</p>
  <p>Then in the concurrent step, only operations allowed are read and update. No delete or add are allowed. So no resize nor rehash would happen (I think).</p>
  <p>Under this scenario, are these containers thread-safe? Any example they would break?</p>
  <p>I have read some questions like <a href="https://stackoverflow.com/a/30759329">1</a> and <a href="https://stackoverflow.com/a/13955871/1409449">2</a> that make me believe they would be thread-safe if each thread writes to a distinct element. <a href="https://stackoverflow.com/a/9685609">3</a> says STL containers are only thread-safe when one thread is writing at a time and no other is reading. I am having a hard time understanding why multiple threads update a same element is not safe? As long as the memory is aligned (no weird partial results), it's just last write wins right?</p>