HSR.ParallelChecker 1.6.0

HSR Parallel Checker NuGet analyzer package:
Static detection of data races, deadlocks and other concurrency issues in C#.

Install-Package HSR.ParallelChecker -Version 1.6.0
dotnet add package HSR.ParallelChecker --version 1.6.0
<PackageReference Include="HSR.ParallelChecker" Version="1.6.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add HSR.ParallelChecker --version 1.6.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

The HSR Parallel Checker is a static analysis that detects data races, deadlocks and other concurrency issues in C#.
The analysis is available as a NuGet package (e.g. for Visual Studio Code) and as a Visual Studio extension.

Visual Studio Code Integration

  1. Install the C# extension in Visual Studio Code, if not yet done.
    a. Menu "File"->"Preferences"->"Extensions"
    b. Search for "C# for Visual Studio Code (powered by Omnisharp)" and install it.
  2. Enable Roslyn analyzers in the setting.
    a. Menu "File"->"Preferences"->"Settings"
    b. Select "Extensions"->"C# configuration"
    c. Go to section "Omnisharp: Enable Roslyn Analyzers"
    d. Enable the option "Enable support for roslyn analyzers, code fixes and rulesets."
  3. Add the NuGet package "HSR.ParallelChecker" to the desired C# projects.
    a. Menu "Termin"-"New Terminal"
    b. Enter "dotnet add package HSR.ParallelChecker"
  4. Checker issues are displayed in the "problems" view and are also highlighted in the code
    a. Menu "View"->"Problems"
  5. If issues do not appear: Close and reopen the C# projects, wait for a moment, optionally run the project

Visual Studio Integration

  1. Open Visual Studio
  2. Menu "Extensions"->"Manage Extensions"
  3. Search for "HSR Parallel Checker for C# 8 (VS 2019)" and install it
  4. Close Visual Studio, follow the installer, and restart Visual Studio

More detailed instructions can be found at the VS Marketplace website of HSR Parallel Checker.

Concurrency Issues

The checker detects the following concurrency (multi-threading) issues with a static analysis, however, not necessarily all of them:

  • 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.

Samples

As a first starting point, you can try the sample C# solutions to detect data races and deadlocks.
You can download the samples from https://parallel-checker.com/Samples

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. It has been designed to efficiently deal with large software projects and find as many issues with high precision as possible.

More Information

You can find more information on the checker website https://parallel-checker.com

The HSR Parallel Checker is a static analysis that detects data races, deadlocks and other concurrency issues in C#.
The analysis is available as a NuGet package (e.g. for Visual Studio Code) and as a Visual Studio extension.

Visual Studio Code Integration

  1. Install the C# extension in Visual Studio Code, if not yet done.
    a. Menu "File"->"Preferences"->"Extensions"
    b. Search for "C# for Visual Studio Code (powered by Omnisharp)" and install it.
  2. Enable Roslyn analyzers in the setting.
    a. Menu "File"->"Preferences"->"Settings"
    b. Select "Extensions"->"C# configuration"
    c. Go to section "Omnisharp: Enable Roslyn Analyzers"
    d. Enable the option "Enable support for roslyn analyzers, code fixes and rulesets."
  3. Add the NuGet package "HSR.ParallelChecker" to the desired C# projects.
    a. Menu "Termin"-"New Terminal"
    b. Enter "dotnet add package HSR.ParallelChecker"
  4. Checker issues are displayed in the "problems" view and are also highlighted in the code
    a. Menu "View"->"Problems"
  5. If issues do not appear: Close and reopen the C# projects, wait for a moment, optionally run the project

Visual Studio Integration

  1. Open Visual Studio
  2. Menu "Extensions"->"Manage Extensions"
  3. Search for "HSR Parallel Checker for C# 8 (VS 2019)" and install it
  4. Close Visual Studio, follow the installer, and restart Visual Studio

More detailed instructions can be found at the VS Marketplace website of HSR Parallel Checker.

Concurrency Issues

The checker detects the following concurrency (multi-threading) issues with a static analysis, however, not necessarily all of them:

  • 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.

Samples

As a first starting point, you can try the sample C# solutions to detect data races and deadlocks.
You can download the samples from https://parallel-checker.com/Samples

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. It has been designed to efficiently deal with large software projects and find as many issues with high precision as possible.

More Information

You can find more information on the checker website https://parallel-checker.com

  • .NETStandard 2.0

    • No dependencies.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version History

Version Downloads Last updated
1.6.0 80 5/23/2020