I am porting some Java code to C++ and wanted to find something that worked like Java’s ThreadPoolExecutor. I saw a few posts suggesting threadpool but after reading a few other forums I have read about problems(memory leaks, etc..) and browsing the code base I see the last update was over 3 years ago. So my problem is, I’m not quite up to speed to make my own thread-pool library but I don’t want to use something that is not actively maintained.
Upon looking around there’s a few threadpool projects but they don’t seem heavily used(I’m basing it on how family favorites/watches on github/code.google). I was wondering what other people are using for threadpools in production environments? I’m looking for 2 types of thread-pools, one fixed and one that grows dynamically.
Which platform ? If windows and can use ppl using Visual C++ compiler, then take
a look at
task_groupandmake_taskmethods to create tasks. Intel TBB isanother option.
If you can use boost, then boost concurrent programming APIs
can be useful.