title: concurrent_vector for 2d array
body: <p>I am currently trying to represent a 2D array using <code>tbb::concurrent_vector&lt;T&gt;</code>. This 2d array will be accessed by a lot of different threads and thats why I want it to handle parallel accesses the most efficiently possible.</p>
  
  <p>I came up with 2 solutions:</p>
  
  <ul>
  <li><p>Use a <code>tbb::concurrent_vector&lt;tbb::concurrent_vector&lt;T&gt; &gt;</code> to store it.</p></li>
  <li><p>Store everything in a <code>tbb::concurrent_vector&lt;T&gt;</code> and access elements w/ <code>x * width + y</code></p></li>
  </ul>
  
  <p>I had a preference for the second one because I dont want to lock an entire row to access one element (since I assume that to access the element <code>array[x][y]</code>, the tbb implementation will lock the <code>x</code>th row and then the <code>y</code>th element).</p>
  
  <p>I would like to know which solution seems better to you.</p>