1 out of 4 rated this helpful - Rate this topic

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)
public int MaxDegreeOfParallelism { get; set; }

Property Value

Type: System.Int32
An integer that represents the maximum degree of parallelism.
Exception Condition
ArgumentOutOfRangeException

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

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.

.NET Framework

Supported in: 4

.NET Framework Client Profile

Supported in: 4

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.
Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ