ParallelHelperBeginFor(Int32, Int32, AsyncConfig, ActionInt32) Method

Begins to execute an indexed loop asynchronously, in which iterations may run in parallel and the execution can be configured.
See the Remarks section of the BeginForT(T, Int32, Int32, AsyncConfig, ActionInt32) overload for details.

Definition

Namespace: KGySoft.Threading
Assembly: KGySoft.CoreLibraries (in KGySoft.CoreLibraries.dll) Version: 10.0.0
C#
public static IAsyncResult BeginFor(
	int fromInclusive,
	int toExclusive,
	AsyncConfig? asyncConfig,
	Action<int> body
)

Parameters

fromInclusive  Int32
The start index, inclusive.
toExclusive  Int32
The end index, exclusive.
asyncConfig  AsyncConfig
An optional configuration to adjust parallelization, cancellation or completion callback. This method does not report progress even if Progress is set in this parameter. To report progress use the BeginForT(T, Int32, Int32, AsyncConfig, ActionInt32) overload.
body  ActionInt32
The delegate that is invoked once per iteration.

Return Value

IAsyncResult
An IAsyncResult that represents the asynchronous operation, which could still be pending.

Exceptions

See Also