I'm doing a little university project where I apply different multi-threading approaches to pattern matching algorithms (pthread, omp) and compare them against their respective sequential implementations.
At the moment it works well, and depending on the algorithm and gcc optimizations, I get shorter run times by a factor of about 2 - 3.
Now, I'd like to do it using std::thread as well, however, from what I've managed to gather, they're implemented using Pthreads on Linux, so I was wondering whether there was any point to this.
std::thread
is a feature provided by the ISO C++ standard language, so it will be available on platforms and implementations which are compliant to C++11, pthread
s on the other hand adheres to IEEE standard and so not a part of the C++ standard.
So if your application or multithreaded code needs to run on various platforms then it would make sense to use std::thread
so that it just works as it is on all platforms without any modification at all. if you are not worried of cross platform compatibility then you are just fine with pthread
s.