Hi folks, I'm currently attempting to create a little facility that will allow me to eaily kick off a function call in another thread and get the result through a "future". Something like: unsigned count_primes_upto(std::size_t max); async::layered_cage < std::exception, std::domain_error, async::catch_all
cage; // to catch exceptions
// call count_primes_upto(9876543210) in another thread
async::future<unsigned> n =
async::call(cage, &count_primes_upto, 9876543210);
// do other stuff in the mean time
// ...
// Block until done. Get result or propagate exception
std::cout << "there are " << n.value() <<
" primes less than " << 9876543210 <<'\n';
To achieve this I'm using boost::bind and boost::function quite heavily.
I've discovered that by the time the final boost::function