3 ms·
The C++11 thread library (http://en.cppreference.com/w/cpp/thread http://en.cppreference.com/w/cpp/thread) is at least not insane, and at best you might even li
by to3m 9y ago
The C++11 thread library (http://en.cppreference.com/w/cpp/thread http://en.cppreference.com/w/cpp/thread) is at least not insane, and at best you might even like it. In my view it's certainly a better bet than pthreads, because it runs on Windows too.
- JDevlieghere 9y agoIndeed, it's portable and part of the standard. Personally I'm a big fan of this implementation: https://github.com/progschj/ThreadPool/ https://github.com/progschj/ThreadPool/
- gcp 9y agoThanks, this looks a lot better than the one in the subject.
- gusmd 9y agoI just finished going through this book: https://www.amazon.com/C-Concurrency-Action-Practical-Multithreading/dp/1933988770 https://www.amazon.com/C-Concurrency-Action-Practical-Multit... Talks in-depth about the thread library and also other C++11 features that made it possible. Highly recommended.
- leohotfn 9y agoThanks. Why don't I use the C++11 thread library? 1, I wrote this code on Linux and it's only used on Linux, so I don't consider portability issues. 2, actually, I dislike some classes name in the C++ thread library, so....