MSVC 并发运行时中的parallel_for_each 和parallel_for 有什么区别?
parallel_for_each
的形式为:
Concurrency::parallel_for_each(start_iterator, end_iterator, function_object);
但 parallel_for
的形式也类似:
Concurrency::parallel_for(start_value, end_value, function_object);
那么 Concurrency::parallel_for
和 之间有什么区别多核编程中使用的 Concurrency::parallel_for_each
算法?
parallel_for_each
is of the form:
Concurrency::parallel_for_each(start_iterator, end_iterator, function_object);
but parallel_for
is also of the similar form:
Concurrency::parallel_for(start_value, end_value, function_object);
so what is the difference between Concurrency::parallel_for
and Concurrency::parallel_for_each
algorithms used in programming for multiple cores?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我不知道你在说什么库,但看起来这个库需要迭代器:
并且可能与此具有相同的效果(尽管不一定按相同的顺序):
例如:
另一个库需要值,所以最有可能它具有与此类似的效果(但同样,没有保证顺序):
尝试运行此:
编辑:您可以在 并行算法参考。
I don't know what library you're talking about, but it looks like this one takes iterators:
And likely has the same effect as this (although not necessarily in the same order):
For example:
The other one takes values, so most likely it has a similar effect to this (but again, no guaranteed order):
Try running this:
EDIT: You can find confirmation of these behaviors in the Parallel Algorithm references.