TaskCreationOptions Enumeration

TaskCreationOptions Enumeration

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

Specifies flags that control optional behavior for the creation and execution of tasks.

This enumeration has a FlagsAttribute attribute that allows a bitwise combination of its member values.

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

[FlagsAttribute]
public enum TaskCreationOptions

Member nameDescription
AttachedToParentSpecifies that a task is attached to a parent in the task hierarchy.
DenyChildAttachSpecifies that an InvalidOperationException will be thrown if an attempt is made to attach a child task to the created task.
HideSchedulerPrevents the ambient scheduler from being seen as the current scheduler in the created task. This means that operations like StartNew or ContinueWith that are performed in the created task will see Default as the current scheduler.
LongRunningSpecifies that a task will be a long-running, coarse-grained operation. It provides a hint to the TaskScheduler that oversubscription may be warranted.
NoneSpecifies that the default behavior should be used.
PreferFairnessA hint to a TaskScheduler to schedule a task in as fair a manner as possible, meaning that tasks scheduled sooner will be more likely to be run sooner, and tasks scheduled later will be more likely to be run later.

Windows Phone OS

Supported in: 8.1, 8.0

Show:
© 2017 Microsoft