Search code examples
c++concurrencyboost-threadppl

VC10 PPL or prepare for STL thread


I'm using MSVC 2010 starting a new MFC-project and now trying to decide which lib to use for concurrent tasks. I know of the new C++0x thread features but it's not implemented in VC10. VC12 is not yet an option but it will come in the future. I do have the Microsoft PPL which looks good to me but we might move from Windows to Linux for new projects to come, so for reusing code maybe staying with the STL is more portable? For that I have the option to use boost in order to change to std with VC12.

My question is what should I prefere, PPL or temporarily boost and then std? I would like to hear your experiences with both, which one is more powerful, more convenience, advantages and disadvantages.


Solution

  • The PPL and the C++11 concurrency libraries are not really direct substitutes. PPL offers a higher level, task based approach to concurrency and can be both easier to work with and more efficient than managing threads directly using std::thread or similar threading libraries. PPL also includes things like parallel algorithms (parallel_for_each, parallel_transform, parallel_reduce, parallel_sort, etc.) and concurrent containers which are not included in the C++11 concurrency libraries.

    It's also worth noting that the PPL and Intel's TBB (Threading Building Blocks) are designed to share the same interface to a large extent and TBB is supported on Linux so there is some cross platform portability when using the PPL. Intel, Microsoft and NVIDIA have a joint proposal for a parallel algorithms library for future versions of the C++ standard (C++14 and beyond) which are based on the PPL/TBB.