2
Contributors
2
Replies
6
Views
4 Years
Discussion Span
Last Post by stereomatching
0

Well, Boost.Thread has the future / promise mechanism, that's where it was taken from. What std::async accomplished under-the-hood to run a thread with the given callable and attaches a future to it is quite simple, at least for the non-deferred launch version. The deferred version is also quite simple to implement in boost.

If you look at the two examples of using a packaged_task / future from the Boost.Thread documentation page, you will find exactly two examples: one async and one deferred (or lazy-future). If you need to give parameters to the function, just use boost::bind . You could even wrap all this in a async() function template that exactly replicates the standard one, it's easy.

This question has already been answered. Start a new discussion instead.
Take the time to help us to help you. Please be thoughtful and detailed and be sure to adhere to our posting rules.