Skip to content

JanSellner/TestProject_ParallelExecution

master
Switch branches/tags
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 

TestProject_ParallelExecution

Class for easy parallelization of for loops in C++. It also covers methods to write the result to a common variable or something to the console in a thread-safe way.

Installation

Only the header ParallelExecution.h is required. Simply download it and add it to your include path.

Usage

To run a loop in parallel, just include the header, create an object of the class ParallelExecution and then use the parallel_for() function.

#include "ParallelExecution.h"
//...
ParallelExecution pe;
pe.parallel_for(0, iterations - 1, [&](const size_t i)  // i = {0, 1, ..., iterations - 1}
{
  // Do stuff in parallel
});

More details can be found in the test program which also covers the usage of the thread-safe functions.

References

Details can be found in the cordesponding blog article.

About

Class for easy parallelization of for loops in C++

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages