StartNew Method

TaskFactory.StartNew Method

[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]

Creates and starts a Task.

This member is overloaded. For complete information about this member, including syntax, usage, and examples, click a name in the overload list.

  NameDescription
Public method StartNew(Action) Creates and starts a Task.
Public method StartNew(Of TResult)(Func(Of TResult)) Creates and starts a Task(Of TResult).
Public method StartNew(Action, CancellationToken) Creates and starts a Task.
Public method StartNew(Action, TaskCreationOptions) Creates and starts a Task.
Public method StartNew(Action(Of Object), Object) Creates and starts a Task.
Public method StartNew(Of TResult)(Func(Of TResult), CancellationToken) Creates and starts a Task(Of TResult).
Public method StartNew(Of TResult)(Func(Of TResult), TaskCreationOptions) Creates and starts a Task(Of TResult).
Public method StartNew(Of TResult)(Func(Of Object, TResult), Object) Creates and starts a Task(Of TResult).
Public method StartNew(Action(Of Object), Object, CancellationToken) Creates and starts a Task.
Public method StartNew(Action(Of Object), Object, TaskCreationOptions) Creates and starts a Task.
Public method StartNew(Of TResult)(Func(Of Object, TResult), Object, CancellationToken) Creates and starts a Task(Of TResult).
Public method StartNew(Of TResult)(Func(Of Object, TResult), Object, TaskCreationOptions) Creates and starts a Task(Of TResult).
Public method StartNew(Action, CancellationToken, TaskCreationOptions, TaskScheduler) Creates and starts a Task.
Public method StartNew(Of TResult)(Func(Of TResult), CancellationToken, TaskCreationOptions, TaskScheduler) Creates and starts a Task(Of TResult).
Public method StartNew(Action(Of Object), Object, CancellationToken, TaskCreationOptions, TaskScheduler) Creates and starts a Task.
Public method StartNew(Of TResult)(Func(Of Object, TResult), Object, CancellationToken, TaskCreationOptions, TaskScheduler) Creates and starts a Task(Of TResult).
Top

NoteNote:

Use the StartNew method only when you require fine-grained control for a long-running, compute-bound task. Starting with the .NET Framework 4.5, the Task.Run method is the recommended way to launch a compute-bound task.

Show:
© 2017 Microsoft