title: vb.net How can I pass a reference to a structure from one thread to two other threads?
body: <p>Thread 1 fills a structure and then launches thread 2 and 3, which each need a reference to same structure, to work with it.<br>
  Can't make copy of structure -- it's big and would take too long BECAUSE the frame arrays within the structure will each be very big -- maybe 25KB each.</p>
  
  <p>Present code gets error when I pass a structure reference to threads 2 and 3 when I start them.</p>
  
  <p>How can I provide thread 2 &amp; 3 with a reference to structure created by thread 1?</p>
  
  <p>THE CODE...  </p>
  
  <pre><code>        Structure Antenna_Frame_Buffer_structure
              dim frame_buffer_index          as integer
              dim board0_frame_array             as Byte()
              dim board1_frame_array             as Byte()
              dim board2_frame_array             as Byte()
              dim need_to_write               as boolean
              dim write_done_flag            as boolean
          end structure
  
          dim     antenna_frame_buffer as Antenna_Frame_Buffer_structure
              ...
  
      ' ONE THREAD STARTS TWO OTHER THREADS.................
              new_buffer_write_thread = new Thread( AddressOf thread1 )
              new_buffer_write_thread.Start( antenna_frame_buffer )   
              new_buffer_write_thread = new Thread( AddressOf thread2 )
              new_buffer_write_thread.Start( antenna_frame_buffer )   
  
              ...
  
  
      'EACH OF OTHER TWO THREADS NEEDS TO REFERENCE SAME STRUCTURE.....
  sub thread1( ByRef antenna_frame_buffer as Antenna_Frame_Buffer_structure ) 
              ...
  end sub
  
  sub thread2( ByRef antenna_frame_buffer as Antenna_Frame_Buffer_structure ) 
              ...
  end sub
  </code></pre>
  
  <p>THE ERROR</p>
  
  <blockquote>
    <p>Severity Code Description Project File Line Suppression State Error
    BC30518 Overload resolution failed because no accessible 'New' can be
    called with these arguments: 'Public Overloads Sub New(start As
    ThreadStart)': Method 'Public Sub frame_buffer_write_Thread(ByRef
    antenna_frame_buffer As
    Embedded_Communication_Interface.Antenna_Frame_Buffer_structure)' does
    not have a signature compatible with delegate 'Delegate Sub
    ThreadStart()'. 'Public Overloads Sub New(start As
    ParameterizedThreadStart)': Method 'Public Sub
    frame_buffer_write_Thread(ByRef antenna_frame_buffer As
    Embedded_Communication_Interface.Antenna_Frame_Buffer_structure)' does
    not have a signature compatible with delegate 'Delegate Sub
    ParameterizedThreadStart(obj As Object)'. SYS HUB and HW GUI
    C:\PRIMARY\WORK\SYSTEM HUB\SOURCE\Embedded_Communication_Interface.vb
    1030 Active</p>
  </blockquote>