dotnet / dotnet/dotnet-api-docs

Misleading remarks about degree of parallelism

Open
#12,637 3 comments 0 reactions 0 assignees View on GitHub
area-System.Threading.Tasks untriaged
Dominant language
C#
Stars
949
Forks
1.7k
Avg merge
3d 27m
Merged PRs (30d)
49

Description

### 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

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.