title: C++ Non-Blocking ASIO Run
body: <p>I have created a series of functions that talk to Libcurl Multi and download files asynchronously via ASIO and Boost.</p>
  
  <p>Obviously though when I call io_service.run it blocks my main thread when it is run. I have tried to make it non blocking but my app crashes.</p>
  
  <p>I was wondering what is the simplest and best approach to running this in the background, in a non-blocking manner and have it call a call-back function when it is done (Like how you can do it in javascript).</p>
  
  <p>So I could just go:</p>
  
  <pre><code>Runthisinthebackground( thingtodo, callback); 
  </code></pre>
  
  <p>It would run the thingtodo and return the result to the callback. One thing though this must use Libraries such as boost that can run on devices with out C++ 11 as its for a mobile app running on Android and iOS</p>