英特尔 TBB 和微软 PPL 有什么区别?
我计划开始“玩”一个跨平台项目的基于任务的并行性。我想使用英特尔线程构建模块。我从 Windows 和 Visual Studio 开始。
由于我暂时只想制作原型,所以我考虑只在 Windows 上“玩”,然后拥有足够的知识在所有兼容平台上使用该库。
我了解到,从 VS2010 开始,微软提供了一个类似的库,即并行处理库,它具有与 Intel TBB(几乎)相同的接口。
包括 TBB 团队博客在内的一些消息来源表明,他们是一起构建的,并且是同一个库。
然而,它并不是很明确,因为人们经常认为这两个库之间存在细微差别。
那么,如果有的话,这些差异是什么?我应该直接从最后一个稳定的 ITBB 开始,还是只在原型中使用 Microsoft PPL 并在跨平台“真实”上使用 ITBB 风险较低项目?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
TBB 是 PPL 的超集(与VS2010中一样),因此它提供了所有PPL API以及PPL没有的自己的API。
请注意,VS2010中的
concurrency命名空间
还包含Concurrency Runtime的API( ConcRT(在其上构建了 PPL)、异步代理等。TBB 没有其中的大部分,尽管它有一些(例如ritic_section
)。作为异步代理的替代方案,TBB 的最新版本采用了新的流程图 API。理论上,要从 PPL 切换到 TBB,您只需替换 ppl.h 所在的路径(对于 TBB,标头位于
/include/tbb/compat
中)当然还有与 TBB DLL 的链接。但在这种情况下,您将仅限于 PPL API。要使用 PPL 中不存在的“额外”TBB API(例如parallel_pipeline
、parallel_reduce
、concurrent_priority_queue
等),您需要从一开始就与 TBB 合作。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 asparallel_pipeline
,parallel_reduce
,concurrent_priority_queue
and other), you need to work with TBB from the very beginning.