ParallelConfig Class

Represents a configuration for parallel operations.

Definition

Namespace: KGySoft.Threading
Assembly: KGySoft.CoreLibraries (in KGySoft.CoreLibraries.dll) Version: 9.0.0
C#
public class ParallelConfig : AsyncConfigBase
Inheritance
Object    AsyncConfigBase    ParallelConfig
Derived

Constructors

ParallelConfig Initializes a new instance of the ParallelConfig class.
ParallelConfig(CancellationToken) Initializes a new instance of the ParallelConfig class initializing the IsCancelRequestedCallback property from a CancellationToken.
This constructor is available only for .NET Framework 4.0 and later.

Properties

IsCancelRequestedCallback Gets or sets a callback that can return whether cancellation has been requested. To use a CancellationToken on .NET Framework 4.0 or later, use the appropriate constructor or the TaskConfig type with Task-returning methods.
Default value: , if the default constructor was called.
MaxDegreeOfParallelism Gets or sets the maximum degree of parallelism. Zero or less means an automatic configuration based on CPU cores. Set one to execute the operation on a single core. The asynchronous operation will not be blocking even if 1 is set.
Default value: 0.
(Inherited from AsyncConfigBase)
Progress Gets or sets an IAsyncProgress instance that can handle progress notifications.
Default value: .
See the Examples section of the IAsyncProgress interface for an example implementation.
(Inherited from AsyncConfigBase)
State Gets or sets a user-provided object that will be returned by the AsyncState property that can be used to distinguish this particular asynchronous operation from other ones. This object will be returned also in the IAsyncContext.State property created by the methods of the AsyncHelper class.
Default value: .
(Inherited from AsyncConfigBase)
ThrowIfCanceled Gets or sets whether an OperationCanceledException should be thrown when ending or awaiting a canceled async operation. If the value of this property is , then canceled non-void operations will return some value, which is usually the default value of their return type.
Default value: .
(Inherited from AsyncConfigBase)

Extension Methods

Convert Converts an Object specified in the obj parameter to the desired targetType.
See the Examples section of the generic ConvertTTarget(Object, CultureInfo) overload for an example.
(Defined by ObjectExtensions)
ConvertTTarget Converts an Object specified in the obj parameter to the desired TTarget.
(Defined by ObjectExtensions)
In Gets whether item is among the elements of set.
See the Examples section of the generic InT(T, T) overload for an example.
(Defined by ObjectExtensions)
TryConvert Tries to convert an Object specified in the obj parameter to the desired targetType.
See the Examples section of the ConvertTTarget(Object, CultureInfo) method for a related example.
(Defined by ObjectExtensions)
TryConvert Tries to convert an Object specified in the obj parameter to the desired targetType.
See the Examples section of the ConvertTTarget(Object, CultureInfo) method for a related example.
(Defined by ObjectExtensions)
TryConvertTTarget Tries to convert an Object specified in the obj parameter to the desired TTarget.
See the Examples section of the ConvertTTarget(Object, CultureInfo) method for a related example.
(Defined by ObjectExtensions)
TryConvertTTarget Tries to convert an Object specified in the obj parameter to the desired TTarget.
See the Examples section of the ConvertTTarget(Object, CultureInfo) method for a related example.
(Defined by ObjectExtensions)

See Also