XII Release 0.1.0
Loading...
Searching...
No Matches
xiiParallelForParams Struct Reference

Settings for xiiTaskSystem::ParallelFor invocations. More...

#include <TaskSystemDeclarations.h>

Public Member Functions

void DetermineThreading (xiiUInt64 uiNumItemsToExecute, xiiUInt32 &out_uiNumTasksToRun, xiiUInt64 &out_uiNumItemsPerTask) const
 

Public Attributes

xiiUInt32 m_uiBinSize = 1
 
xiiUInt32 m_uiMaxTasksPerThread = 2
 
xiiTaskNesting m_NestingMode = xiiTaskNesting::Never
 
xiiAllocatorBasem_pTaskAllocator = nullptr
 The allocator used to for the tasks that the parallel-for uses internally. If null, will use the default allocator.
 

Detailed Description

Settings for xiiTaskSystem::ParallelFor invocations.

Member Data Documentation

◆ m_uiBinSize

xiiUInt32 xiiParallelForParams::m_uiBinSize = 1

The minimum number of items that must be processed by a task instance. If the overall number of tasks lies below this value, all work will be executed purely serially without involving any tasks at all.

◆ m_uiMaxTasksPerThread

xiiUInt32 xiiParallelForParams::m_uiMaxTasksPerThread = 2

Indicates how many tasks per thread may be spawned at most by a ParallelFor invocation. Higher numbers give the scheduler more leeway to balance work across available threads. Generally, if all task items are expected to take basically the same amount of time, low numbers (usually 1) are recommended, while higher numbers (initially test with 2 or 3) might yield better results for workloads where task items may take vastly different amounts of time, such that scheduling in a balanced fashion becomes more difficult.


The documentation for this struct was generated from the following files: