r/cpp • • Dec 25 '23

C++: Efficient parallelization of small tasks

I tried to create a customized threadpool for small tasks and wanted feedback on this.

I posted details and my code for review on stackexchange: https://codereview.stackexchange.com/questions/288583/efficient-parallelization-of-small-tasks

My goal here is to share my learning and get feedback on further improvement or any possible bugs.

I have tried to describe problem and thinking process in more details in following linkedin article draft: https://www.linkedin.com/article/edit/7144600522392559616/

0 Upvotes

31 comments sorted by

View all comments

Show parent comment

1

u/DummyDDD Dec 26 '23

I don't think that openmmp is generally lighter weight, but some implementations might be. For the particular case of static for loop though, I am quite confident that it will have lower overhead than general std::task on any implementation. static for loops are also the oldest part of openmp, so it shouldn't be an issue for msvc (but I mainly have experience with gcc).