Live data from Hacker News

Reuzel – A tiny C++ thread pool

github.com

1–10 of 29 posts

Re: Reuzel – A tiny C++ thread pool

#3
post #2

The C++11 thread library ( 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.

Indeed, it's portable and part of the standard. Personally I'm a big fan of this implementation: https://github.com/progschj/ThreadPool/

Re: Reuzel – A tiny C++ thread pool

#5
post #2

The C++11 thread library ( 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.

Indeed, it's portable and part of the standard. Personally I'm a big fan of this implementation: https://github.com/progschj/ThreadPool/

Thanks, this looks a lot better than the one in the subject.

Re: Reuzel – A tiny C++ thread pool

#9
post #2

The C++11 thread library ( 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.

I just finished going through this book: 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.

Re: Reuzel – A tiny C++ thread pool

#10

PSA: Please don't do stuff like this in header files: using std::string; It's not cool to impose that decision on clients of the library.

Note that this is not the same as "using namespace std;" since you are only exporting the namespace std::string.

This should almost always be ok since no sane programmer should ever name their class string in the namespace of std.

As a developer, I wouldn't feel too bad about causing namespace conflicts in this manner because hopefully it will suggest to the maintainer that their class name is a poor choice.

Post reply on HN