Skip to content

Misleading remarks about degree of parallelism #12637

@baSSiLL

Description

@baSSiLL

Type of issue

Missing information

Description

Hello!

The Remarks section for each overload of Parallel.ForAsync, Parallel.ForEachAsync contains the statement
The operation will execute at most ProcessorCount operations in parallel.
However, this only holds true for those overloads which do not have the ParallelOptions parameter. Specifying a value of ParallelOptions.MaxDegreeOfParallelism greater than Environment.ProcessorCount effectively increases the number of parallel operations above the latter value. I have tested this in a container environment where ProcessorCount evaluates to 1 due to CPU limit.

Page URL

https://learn.microsoft.com/en-us/dotnet/api/system.threading.tasks.parallel.forasync?view=net-10.0#remarks

Content source URL

https://github.com/dotnet/dotnet-api-docs/blob/main/xml/System.Threading.Tasks/Parallel.xml

Document Version Independent Id

0596429c-8a06-a28d-f52c-85fec83cb223

Platform Id

9a4629c1-9f6b-7314-7720-0a7201335a26

Article author

@dotnet-bot

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions