vendredi 29 juillet 2016

Multithreading with C++11

I have a list of jobs, let say N=400 on a 12 core machine. Each of these job took in average a 0.5 second's. The question is: "What is the fastest way to calculate all jobs?"

I've done this with a std::vector of task's, a mutex and 12 runnings threads, each fetching a new job after finish the old one + remove job from vector (with pthread or std::thread).

Now i want to use C++11 and im a little bit confused. std::future, std::packaged_task and std::thread ?

Aucun commentaire:

Enregistrer un commentaire