Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Simple thread pool in C++

Could anyone point me to a sample implementation of a thread pool in C++, please? I'm looking for a very basic one without too much complexity, which would be suitable for a beginner in threading to study.

like image 331
nikhil Avatar asked Mar 05 '26 08:03

nikhil


2 Answers

Look at Intel's Thread Building Blocks. I don't know how well that library meets your "simple" criteria, but it seems to be very well thought-out and thorough. I would think that it would be worth the effort to learn if you want to do threading in C++.

Boost also has some threading facilities.

like image 144
Michael Ekstrand Avatar answered Mar 07 '26 22:03

Michael Ekstrand


It may be worth to check out Qt's QThreadPool implementation.

like image 37
Venemo Avatar answered Mar 07 '26 21:03

Venemo



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!