Navigation
API > API/Runtime > API/Runtime/Core > API/Runtime/Core/Async
References
| Module | Core |
| Header | /Engine/Source/Runtime/Core/Public/Async/ParallelFor.h |
| Include | #include "Async/ParallelFor.h" |
template<typename ContextType, typename BodyType, typename PreWorkType>
void ParallelForWithPreWorkWithExistingTaskContext
(
const TCHAR * DebugName,
TArrayView < ContextType > Contexts,
int32 Num,
int32 MinBatchSize,
BodyType && Body,
PreWorkType && CurrentThreadWorkToDoBeforeHelping,
EParallelForFlags Flags
)
Remarks
General purpose parallel for that uses the taskgraph
Parameters
| Name | Description |
|---|---|
| DebugName; | ProfilingScope and DebugName |
| Contexts; | User-privided array of user-defined task-level context objects |
| Num; | number of calls of Body; Body(0), Body(1), ..., Body(Num - 1) |
| MinBatchSize; | Minimum Size of a Batch (will only launch DivUp(Num, MinBatchSize) Workers |
| Body; | Function to call from multiple threads |
| CurrentThreadWorkToDoBeforeHelping; | The work is performed on the main thread before it starts helping with the ParallelFor proper |
| Flags; | Used to customize the behavior of the ParallelFor if needed. Notes: Please add stats around to calls to parallel for and within your lambda as appropriate. Do not clog the task graph with long running tasks or tasks that block. |