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
intThe value used for initializing MaxDegreeOfParallelism when using TPL.
memoryAllocator
MemoryAllocatorThe MemoryAllocator.
ParallelExecutionSettings(int, int, MemoryAllocator)
Initializes a new instance of the ParallelExecutionSettings struct.
public ParallelExecutionSettings(int maxDegreeOfParallelism, int minimumPixelsProcessedPerTask, MemoryAllocator memoryAllocator)
Parameters
maxDegreeOfParallelism
intThe value used for initializing MaxDegreeOfParallelism when using TPL.
minimumPixelsProcessedPerTask
intThe value for MinimumPixelsProcessedPerTask.
memoryAllocator
MemoryAllocatorThe MemoryAllocator.
Fields
DefaultMinimumPixelsProcessedPerTask
Default value for MinimumPixelsProcessedPerTask.
public const int DefaultMinimumPixelsProcessedPerTask = 4096
Field Value
Properties
MaxDegreeOfParallelism
Gets the value used for initializing MaxDegreeOfParallelism when using TPL.
public int MaxDegreeOfParallelism { get; }
Property Value
MemoryAllocator
Gets the MemoryAllocator.
public MemoryAllocator MemoryAllocator { get; }
Property Value
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
Methods
FromConfiguration(Configuration)
Get the default ParallelExecutionSettings for a Configuration
public static ParallelExecutionSettings FromConfiguration(Configuration configuration)
Parameters
configuration
ConfigurationThe Configuration.
Returns
MultiplyMinimumPixelsPerTask(int)
Creates a new instance of ParallelExecutionSettings
having MinimumPixelsProcessedPerTask multiplied by multiplier
public ParallelExecutionSettings MultiplyMinimumPixelsPerTask(int multiplier)
Parameters
multiplier
intThe value to multiply MinimumPixelsProcessedPerTask with.
Returns
- ParallelExecutionSettings
The modified ParallelExecutionSettings.