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
Type of issue
Missing information
Description
Hello!
The Remarks section for each overload of
Parallel.ForAsync,Parallel.ForEachAsynccontains the statementThe operation will execute at most ProcessorCount operations in parallel.
However, this only holds true for those overloads which do not have the
ParallelOptionsparameter. Specifying a value ofParallelOptions.MaxDegreeOfParallelismgreater thanEnvironment.ProcessorCounteffectively 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