System.Threading.Tasks.Task.Run Method

Queues the specified work to run on the ThreadPool and returns a task handle for that work.

Syntax

public static Task Run (Action action)

Parameters

action
The work to execute asynchronously

Returns

A task that represents the work queued to execute in the ThreadPool.

Remarks

The Task.Run(Action) method is a simpler alternative to the TaskFactory.StartNew(Action) method. It creates a task with the following default values:

Requirements

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