Content deleted Content added
Citation bot (talk | contribs) Add: date. | Use this bot. Report bugs. | Suggested by Abductive | Category:Threads (computing) | #UCB_Category 14/41 |
Syntax highlight |
||
Line 2:
For example, this sequential loop:
<syntaxhighlight lang="cpp">
{
}
</syntaxhighlight>
Can be made into a parallel loop by replacing the for with a <code>parallel_for</code>:▼
▲ for (int x=0; x < width; ++x)
<syntaxhighlight lang="cpp">
▲ //Something parallelizable
// . .
{
▲Can be made into a parallel loop by replacing the for with a parallel_for:
▲ #include <ppl.h>
</syntaxhighlight>
▲ Concurrency::parallel_for (0, width, [=](int x)
▲ //Something parallelizable
▲ });
This still requires the developer to know that the loop is parallelizable, but all the other work is done by the library.
|