stdasync

Can I use std::async without waiting for the future limitation?

妖精的绣舞 提交于 2019-11-26 09:35:26
问题 High level I want to call some functions with no return value in a async mode without waiting for them to finish. If I use std::async the future object doesn\'t destruct until the task is over, this make the call not sync in my case. Example void sendMail(const std::string& address, const std::string& message) { //sending the e-mail which takes some time... } myResonseType processRequest(args...) { //Do some processing and valuate the address and the message... //Sending the e-mail async auto

Which std::async implementations use thread pools?

南笙酒味 提交于 2019-11-26 08:11:41
问题 One of the advantages of using std::async instead of manually creating std::thread objects is supposed to be that std::async can use thread pools under the covers to avoid oversubscription problems. But which implementations do this? My understanding is that Microsoft\'s implementation does, but what about these other async implementations? Gnu\'s libstdc++ Gnu\'s libc++ Just Software\'s library Boost (for boost::thread::async , not std::async ) Thanks for any information you can offer. 回答1: