本文介绍了ppl。的替代方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我问过,我触及了微软提供的ppl.h中的parallel_for主题。

但是在我意识到通过使用它,使得他的应用程序不可移植(如果我是对的它特定于Microsoft(ppl.h头))。

在我看来,这打破了C ++中可编程性的一个非常重要的方面 - 可移植性,我只是不准备这样做。

所以我的问题是:

1.我是说,使用parallel_for从ppl使你的代码不可移植(通过不可移植我的意思是它不能被编译的编译器,而不是一个从MS )

2.我是对的说,如果在后期阶段,我想为我的工作在应用程序的时候提供UI(在Qt中完成),使用parallel_for在我的代码将是一个阻塞,这意味着我将替换parallel_for一些其他(便携式)替代品,或者我将无法在Qt和核心在VS中做UI?

3.什么是(便携式)替代品ppl?

In my previous question I've asked, I touched the parallel_for subject from ppl.h provided by Microsoft.
But shortly after I've realized that by using it one makes his application unportable (if I'm right it is specific to Microsoft (the ppl.h header)).
In my opinion this breaks very important aspect of programming in C++ - portability, and I'm just not prepare to do it.
So my questions are:
1. Am I right in saying that using parallel_for from ppl makes your code unportable (by unportable I mean that it cannot be compiled by other compiler than the one from MS)
2. Am I right in saying that if on later stage I want to provide UI (done in Qt) for the application I'm working on at the momment, using parallel_for in my code will be an obstruction which would mean that either I'll replace parallel_for with some other (portable) alternative or I won't be able to do UI in Qt and core in VS?
3. What are the (portable) alternatives to ppl?

推荐答案

您可能想考虑英特尔的。与OpenMP不同,TBB实际上使用C ++,而不是简单地在C ++编译器下编译(即:是一个可以编译为C ++的C库)。它有许多在PPL中看到的东西,但它是跨平台的。

You may want to consider Intel's Thread Building Blocks. Unlike OpenMP, TBB actually uses C++, rather than simply compiling under a C++ compiler (ie: being a C library that can compile as C++). It has many of the things you see in PPL, but it is cross-platform.

还有Boost.Thread,它是C ++(虽然不像TBB是),它是跨平台的。

There is also Boost.Thread, which is C++ (though not quite as direct as TBB is), and it is cross-platform.

这篇关于ppl。的替代方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

06-26 00:19