Parallel.Invoke Method (ParallelOptions, Action[])

.NET Framework (current version)

Executes each of the provided actions, possibly in parallel, unless the operation is cancelled by the user.

Namespace:   System.Threading.Tasks
Assembly:  mscorlib (in mscorlib.dll)

public static void Invoke(
	ParallelOptions parallelOptions,
	params Action[] actions


Type: System.Threading.Tasks.ParallelOptions

An object that configures the behavior of this operation.

Type: System.Action[]

An array of actions to execute.

Exception Condition

The CancellationToken in the parallelOptions is set.


The actions argument is null.


The parallelOptions argument is null.


The exception that is thrown when any action in the actions array throws an exception.


The actions array contains a null element.


The CancellationTokenSource associated with the CancellationToken in the parallelOptions has been disposed.

This method can be used to execute a set of operations, potentially in parallel. The cancellation token passed in with the ParallelOptions structure enables the caller to cancel the entire operation. For more information, see Cancellation in Managed Threads.

No guarantees are made about the order in which the operations execute or whether they execute in parallel. This method does not return until each of the provided operations has completed, regardless of whether completion occurs due to normal or exceptional termination.

For more information, see How to: Use Parallel.Invoke to Execute Parallel Operations.

Universal Windows Platform
Available since 8
.NET Framework
Available since 4.0
Portable Class Library
Supported in: portable .NET platforms
Windows Phone
Available since 8.1
Return to top