title: Multithreaded array of arrays?
body: <p>I have a data structure which consists of 1,000 array elements, each array element is a smaller array of 8 ints:</p>
  
  <pre><code>std::array&lt;std::array&lt;int, 8&gt;, 1000&gt;
  </code></pre>
  
  <p>The data structure contains two "pointers", which track the largest and smallest populated array elements (within the "outer", 1000-element array). So for example they might be:</p>
  
  <pre><code>min = 247 
  max = 842
  </code></pre>
  
  <p>How can I read and write to this data structure from multiple threads? I am worried about race conditions between pushing/popping elements and maintaining the two "pointers". My basic mode of operation is:</p>
  
  <pre><code>// Pop element from current index
  // Calculate new index
  // Write element to new index
  // Update min and max "pointers"
  </code></pre>