Skip to content

Commit

Permalink
feat: Changed Behavior of MaxLevelOfParallelismAttribute (#393)
Browse files Browse the repository at this point in the history
* feat: Changed Behavior of `MaxLevelOfParallelismAttribute`

Instead of `Environment.ProcessCount - 1` the alternative Value is `(int)(Environment.ProcessorCount * .75)`

* docs: Updated Package descriptions
  • Loading branch information
samtrion authored Apr 26, 2024
1 parent 011e4f9 commit f579cb8
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<PropertyGroup>
<Title>$(PackageId)</Title>
<Description>This library provides various compatibility features between `NUnit` and `XUnit`.</Description>
<Description>This library provides various compatibility features between `NUnit`, `XUnit` and `MSTest`.</Description>

<CopyrightYearStart>2023</CopyrightYearStart>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,5 @@ public sealed class MaxLevelOfParallelismAttribute : PropertyAttribute
/// </summary>
/// <param name="level">The number of worker threads to be created by the framework.</param>
public MaxLevelOfParallelismAttribute(int level)
: this(level, Environment.ProcessorCount - 1) { }

/// <summary>
/// Construct a <see cref="MaxLevelOfParallelismAttribute"/>.
/// </summary>
/// <param name="level">The number of worker threads to be created by the framework.</param>
/// <param name="alternativeLevel">The number of workers, which should be used alternatively.</param>
public MaxLevelOfParallelismAttribute(int level, int alternativeLevel)
: base("LevelOfParallelism", Math.Min(level, alternativeLevel)) { }
: base("LevelOfParallelism", Math.Min(level, (int)(Environment.ProcessorCount * .75))) { }
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
using NetEvolve.Extensions.NUnit;

[assembly: MaxLevelOfParallelism(12)]

0 comments on commit f579cb8

Please sign in to comment.