ParallelOptions.MaxDegreeOfParallelism Property (System.Threading.Tasks)

Switch View :
ScriptFree
.NET Framework Class Library
ParallelOptions.MaxDegreeOfParallelism Property

Gets or sets the maximum degree of parallelism enabled by this ParallelOptions instance.

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

Visual Basic
Public Property MaxDegreeOfParallelism As Integer
	Get
	Set
C#
public int MaxDegreeOfParallelism { get; set; }
Visual C++
public:
property int MaxDegreeOfParallelism {
	int get ();
	void set (int value);
}
F#
member MaxDegreeOfParallelism : int with get, set

Property Value

Type: System.Int32
An integer that represents the maximum degree of parallelism.
Exceptions

Exception Condition
ArgumentOutOfRangeException

The exception that is thrown when this MaxDegreeOfParallelism is set to 0 or some value less than -1.

Remarks

The MaxDegreeOfParallelism limits the number of concurrent operations run by Parallel method calls that are passed this ParallelOptions instance to the set value, if it is positive. If MaxDegreeOfParallelism is -1, then there is no limit placed on the number of concurrently running operations.

Version Information

.NET Framework

Supported in: 4

.NET Framework Client Profile

Supported in: 4
Platforms

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
See Also

Reference