csharp-concurrency-patterns

Select .NET concurrency patterns for async/await, Channels, Rx, and Akka.NET.

Updated Mar 3, 2026
One-click install
npx skills add https://github.com/Thorstensen/claude-template --skill csharp-concurrency-patterns-thorstensen
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: csharp-concurrency-patterns
Source: https://github.com/Thorstensen/claude-template/tree/main/.claude/skills/csharp-concurrency-patterns
Command: npx skills add https://github.com/Thorstensen/claude-template --skill csharp-concurrency-patterns-thorstensen

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

The skill guides developers in selecting the most appropriate concurrency abstraction in .NET, helping avoid deadlocks, race conditions, and excessive locking by balancing async/await, channels, Rx, and Akka.NET patterns for scalable, maintainable code.

Core Features & Use Cases

  • Guidance on when to use async/await vs channels, actors, and reactive extensions
  • Patterns and decision trees for common concurrency scenarios in .NET
  • Real-world examples and best practices to reduce shared mutable state

Quick Start

Identify a .NET project with I/O-bound tasks or producer/consumer needs and apply the recommended concurrency pattern to model the workflow.

Frequently Asked Questions about csharp-concurrency-patterns

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
What is the best .NET concurrency pattern for producer/consumer queues?

Channels are the optimal .NET concurrency pattern for producer/consumer queues, providing safe backpressure and state isolation. This skill helps you apply decision trees to identify when channels outperform standard async/await workflows.

How do I prevent deadlocks and race conditions in async/await C# code?

To prevent deadlocks and race conditions in async/await code, you must reduce shared mutable state and apply safe isolation patterns. This skill defines rules and examples that enforce safe concurrent execution across I/O-bound tasks.

When should I use Akka.NET actors instead of async/await for stateful entity management?

You should use Akka.NET actors instead of async/await when managing stateful entities that require strict isolation and message-driven concurrency. This skill guides the selection of actors to balance scalability and maintainability in complex .NET applications.

Does Reactive Extensions (Rx) work well for streaming data in .NET?

Reactive Extensions (Rx) works well for handling streaming data in .NET by modeling asynchronous data streams with observable sequences. This skill helps determine when Rx is the right choice compared to channels and async/await.

How do I choose between channels and Rx for concurrent workflows?

Choosing between channels and Rx depends on whether your workflow needs producer/consumer backpressure or reactive stream transformations. This skill provides patterns to evaluate your specific I/O-bound tasks and select the appropriate abstraction.

Can I apply these concurrency patterns to existing dotnet projects with excessive locking?

Yes, you can apply these concurrency patterns to existing dotnet projects to refactor away from excessive locking. The skill provides real-world examples and best practices to migrate towards scalable and maintainable concurrent code.