Threading.Analyzer
1.0.0
dotnet add package Threading.Analyzer --version 1.0.0
NuGet\Install-Package Threading.Analyzer -Version 1.0.0
<PackageReference Include="Threading.Analyzer" Version="1.0.0"> <PrivateAssets>all</PrivateAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets> </PackageReference>
<PackageVersion Include="Threading.Analyzer" Version="1.0.0" />
<PackageReference Include="Threading.Analyzer"> <PrivateAssets>all</PrivateAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets> </PackageReference>
paket add Threading.Analyzer --version 1.0.0
#r "nuget: Threading.Analyzer, 1.0.0"
#:package Threading.Analyzer@1.0.0
#addin nuget:?package=Threading.Analyzer&version=1.0.0
#tool nuget:?package=Threading.Analyzer&version=1.0.0
Threading Analyzer for C#
Analyzer that finds dependency free asynchronous tasks and give a warning that they should be run in parallel instead, using Task.WhenAll or using Federico Alterio's Task extensions for allowing you to await a tuple of tasks directly. https://www.codeproject.com/articles/Awaiting-a-Tuple-of-Tasks-in-Csharp
Why?
Awaiting tasks in a waterfall manner that could be run in parallel degrades the performance of your application since you could be running all tasks at the same time and minimize the response time of the application.
A minimal example is:
public async Task<UserInfo> GetUserInfo(Guid userId) {
var dbUser = await _db.GetUserById(userId);
var externalUserInfo = await _userApi.GetUserById(userId);
}
Here we won't even start to try to get the user info from the external api until we have gotten the user info from the database. There is no dependency between the tasks and so they should be run in parallel to minimize the response times.
public async Task<UserInfo> GetUserInfo(Guid userId) {
var (dbUser, externalUserInfo) = await (
_db.GetUserById(userId),
_userApi.GetUserById(userId)
);
}
Now we're running both tasks at the same time, in parallel.
Learn more about Target Frameworks and .NET Standard.
This package has no dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.0.0 | 175 | 12/5/2025 |