title: Threading plus interop in program
body: <p>I have a WPF C# application, in which a certain function takes quite a long time for performing its operation.</p>
  
  <pre><code>int result = MyFavFunctions.mainfunction(searchquery);
  </code></pre>
  
  <p>I want to perform the calculation for this function on a separate thread, and not block the UI thread. In addition, before I get the result of this operation, I don't want to proceed with further in the function because <code>int result</code> is what I am using further.</p>
  
  <p>Can this be done with threading?</p>
  
  <p>In addition, I also am not sure because the functions in this mainfunction is actually exported function from a C++ dll. So, after this main function, if I use other exported functions in the dll (which are just used to fetch values), will they have the appropriate result?</p>