title: Passing data structures to different threads
body: <p>I have an application that will be spawning multiple threads.  However, I feel there might be an issue with threads accessing data that they shouldn't be.</p>
  
  <p>Here is the structure of the threaded application (sorry for the crudeness):</p>
  
  <pre><code>                   MainThread
                    /          \
                   /            \
                  /              \
          Thread A               Thread B
         /        \              /       \
        /          \            /         \
       /            \          /           \
  Thread A_1     Thread A_2   Thread B_1    Thread B_2
  </code></pre>
  
  <p>Under each lettered thread (which could be many), there will only be two threads and they are fired of sequentially.  The issue i'm having is I'm not entirely sure how to pass in a datastructure into these threads.  </p>
  
  <p>So, the datastructure is created in MainThread, will be modified in the lettered thread (Thread A, etc) specific to that thread and then a member variable from that datastructure is sent to Letter_Numbered threads.</p>
  
  <p>Currently, the lettered thread class has a member variable and when the class is constructed, the datastructure from mainthread is passed in by reference, invoking the copy constructor so the lettered thread has it's own copy to play with.  </p>
  
  <p>The lettered_numbered thread simply takes in a string variable from the data structure within the lettered thread.  My question is, is this accceptable?  Is there a much better way to ensure each lettered thread gets its own data structure to play with?</p>
  
  <p>Sorry for the somewhat poor explanation, please leave comments and i'll try to clarify.</p>
  
  <p>EDIT:
  So my lettered thread constructor should take the VALUE of the data structure, not the reference?</p>