title: Thread design and design and calling a function in one thread from another in C++ Win32
body: <p>Say you have two threads in Win32.  Let's say the main UI thread launches a worker thread A. Let's say when Thread A was created a pointer back to a class in the main thread was sent to thread A.  At some point during it's processing, Thread A calls a function in the main thread via the pointer.  Thread A and the main thread will never contend for the same data and never call the same function at the same time.</p>
  
  <p>Is this bad practice? </p>
  
  <p>And if it is then what would be the correct design for this functionality.  Thread A needs access to the function in the main thread say to access data kept in the main thread.  It's expected though that Thread A will never call the function in the main thread when the main thread is accessing the data.  Thus there would be no contention over the data.  However, the main thread may start up again while thread a is still calling into the function in the main thread.  </p>
  
  <p>Does this matter or is it generally OK to call functions in other threads so long as there is no data contention and the functions being called into are reentrant?</p>