I have created a series of functions that talk to Libcurl Multi and download files asynchronously via ASIO and Boost.
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.
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).
So I could just go:
Runthisinthebackground( thingtodo, callback);
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