AdaskoTheBeAsT.ConcurrencyLab.ParallelChecker 2.7.0.11

dotnet add package AdaskoTheBeAsT.ConcurrencyLab.ParallelChecker --version 2.7.0.11                
NuGet\Install-Package AdaskoTheBeAsT.ConcurrencyLab.ParallelChecker -Version 2.7.0.11                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="AdaskoTheBeAsT.ConcurrencyLab.ParallelChecker" Version="2.7.0.11" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add AdaskoTheBeAsT.ConcurrencyLab.ParallelChecker --version 2.7.0.11                
#r "nuget: AdaskoTheBeAsT.ConcurrencyLab.ParallelChecker, 2.7.0.11"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install AdaskoTheBeAsT.ConcurrencyLab.ParallelChecker as a Cake Addin
#addin nuget:?package=AdaskoTheBeAsT.ConcurrencyLab.ParallelChecker&version=2.7.0.11

// Install AdaskoTheBeAsT.ConcurrencyLab.ParallelChecker as a Cake Tool
#tool nuget:?package=AdaskoTheBeAsT.ConcurrencyLab.ParallelChecker&version=2.7.0.11                

Parallel Checker

The Parallel Checker is a static analyzer for Visual Studio® and VS Code that detects data races, deadlocks, and other concurrency issues in C#.

Version 2.7.0 Released

The latest Parallel Checker release 2.7.0 provides compatbility with the latest Visual Studio® 2022 versions 17.4.2 onwards. The update is available on Visual Studio® Marketplace.

Highlights

  • Static: Finds issues that are hard to identify through tests.
  • Fast: Takes only a few seconds, even for large projects.
  • Precise: Detects real issues that can occur indeed at runtime.
  • Interactive: Highlights issues while coding in Visual Studio® or VS Code IDE.

Installation

Total Downloads/Installs: >10,000 (December 2022)

More details can found under installation instructions.

Visual Studio® Extension

You can find the Parallel Checker as a Visual Studio® extension in the Visual Studio® Marketplace:

NuGet Package (for e.g. VS Code)

To use the Parallel Checker in VS Code, you need to integrate its NuGet analyzer package in your C# project.

Concurrency Issues

The checker detects the following concurrency (multi-threading) issues with a static analysis:

  • Data Races: Unsynchronized concurrent accesses to same variable or array element, involving at least a write.
  • Deadlocks: Constellations in which multiple threads block each other cyclically forever.
  • Thread-Unsafe Usage: Unsynchronized concurrent calls or accesses of application programming interfaces that are not specified to be thread safe.

The abovementioned issues are all fundamental programming bugs that can lead to program errors. These issues occur non-deterministically, possibly sporadically or very seldom. They are therefore hard to identify in tests and are not easily reproducible. For this reason, it makes sense to use a static analysis that examines various program traces, including very specific or seldom cases, as to whether they suffer from such issues.

How It Works

The checker is implemented based on the compiler framework Roslyn and analyzes the C# source code without executing the program, called static analysis. It screens as many interesting program traces as possible within defined deterministic bounds. The analysis maintains exact and complete context information for the program, where possible. Exceptions are e.g. external input/output and missing or incorrect source code parts, in which case conservative assumptions are made. The properties of the checker can be summarized as:

  • Precise: Real issues are reported without false positives (no false alarms), except when making conservative assumptions.
  • Incomplete: The checker may miss potential issues (possible false negatives) as there exists no precise and complete analysis.
  • Deterministic: The same issues are repeatedly reported for the same program.

The checker engages a new algorithm that has been designed to efficiently deal with large software projects and find as many issues with high precision as possible.

More technical information on the checker algorithm and design can be found in the following academic publication (open access):

    1. Bläser. Practical Detection of Concurrency Issues at Coding Time. International Symposium on Software Testing and Analysis (ISSTA) 2018, Amsterdam, The Netherlands, In ACM Digital Library, July 2018.

Scope

The checker supports the following .NET programming concepts and C# language features:

  • .NET threads, Task Parallel Library, Async/Await, Parallel Invoke/For/ForEach
  • Exact information about objects (aliases, shapes), array indexes etc.
  • DLLs, WPF, WinForm, unit test libraries, console applications
  • Solution-wide analysis
  • C# 10 downwards
  • All standard synchronization primitives, incl. monitor
  • Memory barriers, atomic / Interlocked, volatile, thread-local variables
  • Collection API analysis
  • Finalizer-related concurrency

Certain limitations apply, please see the download section for more details.

Impression

The following screenshot shows a detected data race issue for a C# code in Visual Studio: The two methods Deposit() and Withdraw() are concurrently invoked on the same instance of BankAccount. The checker has verified that there indeed exist multiple threads that concurrently call Deposit()/Withdraw() on the same instance. There is no mutual lock exclusion between these two method executions, as only Withdraw() establishes a monitor lock on _sync. Thus, unsynchronized concurrent read/write, write/read and write/write accesses are effected by the corresponding method bodies.

Screenshot of a data race identified by the parallel checker

More examples are contained in the samples section.


Notice: Microsoft, Visual Studio, and Visual Basic are either registered trademarks or trademarks of Microsoft Corporation in the United States and/or other countries.

All trademarks, trade names etc. are the property of their respective owners.

OST, Parallel Checker, and the contributors DO NOT have any affiliation with any mentioned trademark holders.

There are no supported framework assets in this package.

Learn more about Target Frameworks and .NET Standard.

  • .NETStandard 2.0

    • 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
2.7.0.11 2,293 8/18/2024
2.7.0.10 286 7/23/2024
2.7.0.4 1,208 5/27/2024
2.7.0.3 2,416 3/5/2024
2.7.0.1 898 2/11/2024