The "ParallelFor" function should divide a for loop into chucks which are each their own job. These jobs then execute through the fiber scheduler. Take a look at Soul Engine\Source\Parallelism\Fiber\Scheduler.h/.cpp at ForEachThread which executes a callable on each thread. You can implement different varieties of the "ParallelFor" function. Maybe one would be for std conforming containers like https://en.cppreference.com/w/cpp/algorithm/for_each. Maybe for pure iteration, you would take a parameter such as iterationCount and another for taskCount. Maybe the given callable would require a value i as its first parameter, allowing it to make use of its ID.
This is a smaller task, but heavy on C++ knowledge.
The "ParallelFor" function should divide a for loop into chucks which are each their own job. These jobs then execute through the fiber scheduler. Take a look at
Soul Engine\Source\Parallelism\Fiber\Scheduler.h/.cpp
atForEachThread
which executes a callable on each thread. You can implement different varieties of the "ParallelFor" function. Maybe one would be forstd
conforming containers like https://en.cppreference.com/w/cpp/algorithm/for_each. Maybe for pure iteration, you would take a parameter such asiterationCount
and another fortaskCount
. Maybe the given callable would require a valuei
as its first parameter, allowing it to make use of its ID.This is a smaller task, but heavy on C++ knowledge.