What are the differences between Intel TBB and Microsoft PPL?

╄→гoц情女王★ 提交于 2019-11-27 20:12:30

问题


I'm planning to start "playing" with task-based parallelism for a cross-platform project. I wanted to use Intel Threading Building Blocks. I'm starting with Windows and Visual Studio.

As I just want to prototype for the moment, I'm thinking about "playing" only on windows, then have enough knowledge to use the library on all compatible platforms.

I've learned that since VS2010, Microsoft provide a similar library, Parallel Processing Library, that have (almost) the same interface than Intel TBB.

Some sources suggest, including TBB's team blog, that they build it together and that it's the same library.

However its not really explicit because it's often suggested that there are minor differences between the two libraries.

So, what are those differences, if any? Should I start directly with last stable ITBB or is it low-risk to just play with Microsoft PPL in prototypes and use ITBB on the cross-platform "real" project?


回答1:


TBB is a superset of PPL (as in VS2010), so it provides all PPL API plus its own APIs that PPL does not have.

Note that namespace Concurrency in VS2010 also contains APIs of Concurrency Runtime (ConcRT, on top of which PPL is built), Asynchronous Agents and etc. TBB does not have most of that, though it has some (e.g. critical_section). As an alternative to Asynchronous Agents, the recent version of TBB features the new flow graph API.

In theory, to switch from PPL to TBB, you just need to replace a path from where you take ppl.h (with TBB, the header comes in <tbbdir>/include/tbb/compat) and of course link with the TBB DLL. However in this case you will be limited to PPL API. To use the "extra" TBB API that does not exist in PPL (such as parallel_pipeline, parallel_reduce, concurrent_priority_queue and other), you need to work with TBB from the very beginning.



来源:https://stackoverflow.com/questions/7515097/what-are-the-differences-between-intel-tbb-and-microsoft-ppl

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!