Struct ParallelExecutionSettings
Defines execution settings for methods in ParallelRowIterator.
Inherited Members
Namespace: SixLabors.ImageSharp.Advanced
Assembly: SixLabors.ImageSharp.dll
Syntax
public readonly struct ParallelExecutionSettings
Constructors
| Edit this page View SourceParallelExecutionSettings(int, MemoryAllocator)
Initializes a new instance of the ParallelExecutionSettings struct.
Declaration
public ParallelExecutionSettings(int maxDegreeOfParallelism, MemoryAllocator memoryAllocator)
Parameters
Type | Name | Description |
---|---|---|
int | maxDegreeOfParallelism | 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.
Declaration
public ParallelExecutionSettings(int maxDegreeOfParallelism, int minimumPixelsProcessedPerTask, MemoryAllocator memoryAllocator)
Parameters
Type | Name | Description |
---|---|---|
int | maxDegreeOfParallelism | The value used for initializing MaxDegreeOfParallelism when using TPL. |
int | minimumPixelsProcessedPerTask | The value for MinimumPixelsProcessedPerTask. |
MemoryAllocator | memoryAllocator | The MemoryAllocator. |
Fields
| Edit this page View SourceDefaultMinimumPixelsProcessedPerTask
Default value for MinimumPixelsProcessedPerTask.
Declaration
public const int DefaultMinimumPixelsProcessedPerTask = 4096
Field Value
Type | Description |
---|---|
int |
Properties
| Edit this page View SourceMaxDegreeOfParallelism
Gets the value used for initializing MaxDegreeOfParallelism when using TPL.
Declaration
public int MaxDegreeOfParallelism { get; }
Property Value
Type | Description |
---|---|
int |
MemoryAllocator
Gets the MemoryAllocator.
Declaration
public MemoryAllocator MemoryAllocator { get; }
Property Value
Type | Description |
---|---|
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.)
Declaration
public int MinimumPixelsProcessedPerTask { get; }
Property Value
Type | Description |
---|---|
int |
Methods
| Edit this page View SourceFromConfiguration(Configuration)
Get the default ParallelExecutionSettings for a Configuration
Declaration
public static ParallelExecutionSettings FromConfiguration(Configuration configuration)
Parameters
Type | Name | Description |
---|---|---|
Configuration | configuration | The Configuration. |
Returns
Type | Description |
---|---|
ParallelExecutionSettings |
MultiplyMinimumPixelsPerTask(int)
Creates a new instance of ParallelExecutionSettings
having MinimumPixelsProcessedPerTask multiplied by multiplier
Declaration
public ParallelExecutionSettings MultiplyMinimumPixelsPerTask(int multiplier)
Parameters
Type | Name | Description |
---|---|---|
int | multiplier | The value to multiply MinimumPixelsProcessedPerTask with. |
Returns
Type | Description |
---|---|
ParallelExecutionSettings | The modified ParallelExecutionSettings. |