Note

Access to this page requires authorization. You can try signing in or .

Access to this page requires authorization. You can try .

ParallelOptions Class

Definition

Namespace:
System.Threading.Tasks
Assemblies:
mscorlib.dll, System.Threading.Tasks.Parallel.dll
Assemblies:
netstandard.dll, System.Threading.Tasks.Parallel.dll
Assembly:
System.Threading.Tasks.Parallel.dll
Assembly:
mscorlib.dll
Assembly:
netstandard.dll
Source:
Parallel.cs
Source:
Parallel.cs
Source:
Parallel.cs
Source:
Parallel.cs
Source:
Parallel.cs

Important

Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.

Stores options that configure the operation of methods on the Parallel class.

public ref class ParallelOptions
public class ParallelOptions
type ParallelOptions = class
Public Class ParallelOptions
Inheritance
ParallelOptions

Remarks

By default, methods on the Parallel class attempt to use all available processors, are non-cancelable, and target the default TaskScheduler (TaskScheduler.Default). ParallelOptions enables overriding these defaults.

Constructors

Name Description
ParallelOptions()

Initializes a new instance of the ParallelOptions class.

Properties

Name Description
CancellationToken

Gets or sets the CancellationToken associated with this ParallelOptions instance.

MaxDegreeOfParallelism

Gets or sets the maximum number of concurrent tasks enabled by this ParallelOptions instance.

TaskScheduler

Gets or sets the TaskScheduler associated with this ParallelOptions instance. Setting this property to null indicates that the current scheduler should be used.

Methods

Name Description
Equals(Object)

Determines whether the specified object is equal to the current object.

(Inherited from Object)
GetHashCode()

Serves as the default hash function.

(Inherited from Object)
GetType()

Gets the Type of the current instance.

(Inherited from Object)
MemberwiseClone()

Creates a shallow copy of the current Object.

(Inherited from Object)
ToString()

Returns a string that represents the current object.

(Inherited from Object)

Applies to

Thread Safety

The constructor is thread-safe and may be used by multiple threads concurrently to construct multiple instances. None of the other public members are thread-safe.

See also


Feedback

Was this page helpful?