Table of Contents

Struct ParallelExecutionSettings

Namespace
SixLabors.ImageSharp.Advanced
Assembly
SixLabors.ImageSharp.dll

Defines execution settings for methods in ParallelRowIterator.

public readonly struct ParallelExecutionSettings
Inherited Members

Constructors

ParallelExecutionSettings(int, MemoryAllocator)

Initializes a new instance of the ParallelExecutionSettings struct.

public ParallelExecutionSettings(int maxDegreeOfParallelism, MemoryAllocator memoryAllocator)

Parameters

maxDegreeOfParallelism int

The value used for initializing MaxDegreeOfParallelism when using TPL.

memoryAllocator MemoryAllocator

The MemoryAllocator.

ParallelExecutionSettings(int, int, MemoryAllocator)

Initializes a new instance of the ParallelExecutionSettings struct.

public ParallelExecutionSettings(int maxDegreeOfParallelism, int minimumPixelsProcessedPerTask, MemoryAllocator memoryAllocator)

Parameters

maxDegreeOfParallelism int

The value used for initializing MaxDegreeOfParallelism when using TPL.

minimumPixelsProcessedPerTask int

The value for MinimumPixelsProcessedPerTask.

memoryAllocator MemoryAllocator

The MemoryAllocator.

Fields

DefaultMinimumPixelsProcessedPerTask

Default value for MinimumPixelsProcessedPerTask.

public const int DefaultMinimumPixelsProcessedPerTask = 4096

Field Value

int

Properties

MaxDegreeOfParallelism

Gets the value used for initializing MaxDegreeOfParallelism when using TPL.

public int MaxDegreeOfParallelism { get; }

Property Value

int

MemoryAllocator

Gets the MemoryAllocator.

public MemoryAllocator MemoryAllocator { get; }

Property Value

MemoryAllocator

MinimumPixelsProcessedPerTask

Gets the minimum number of pixels being processed by a single task when parallelizing operations with TPL. Launching tasks for pixel regions below this limit is not worth the overhead. Initialized with DefaultMinimumPixelsProcessedPerTask by default, the optimum value is operation specific. (The cheaper the operation, the larger the value is.)

public int MinimumPixelsProcessedPerTask { get; }

Property Value

int

Methods

FromConfiguration(Configuration)

public static ParallelExecutionSettings FromConfiguration(Configuration configuration)

Parameters

configuration Configuration

The Configuration.

Returns

ParallelExecutionSettings

The ParallelExecutionSettings.

MultiplyMinimumPixelsPerTask(int)

Creates a new instance of ParallelExecutionSettings having MinimumPixelsProcessedPerTask multiplied by multiplier

public ParallelExecutionSettings MultiplyMinimumPixelsPerTask(int multiplier)

Parameters

multiplier int

The value to multiply MinimumPixelsProcessedPerTask with.

Returns

ParallelExecutionSettings

The modified ParallelExecutionSettings.