mardi 22 décembre 2020

Run task without return value: is there a cases when I would prefer std::async over std::thread?

So far my understanding is that if I need to run a task in other thread, but I don't need any return value from that task I always should use std::thread, as I don't need std::future, provided from std::async. But I'm still in doubt, can there be a case where using std::async would be more beneficial?

Aucun commentaire:

Enregistrer un commentaire