
Csharp Concurrency Patterns
Decision guide for choosing among async/await, Channels, Rx, Akka.NET Streams, and Akka.NET Actors in .NET, avoiding locks where possible.
- skills.sh installs
- 1.6K
- GitHub stars
- 1.3K
- last updated
- Aug 21, 2026
Own this skill? Claim it
What it does
- Covers a decision tree that maps each concurrency need, from I/O waits to entity state, to the right .NET abstraction
- Includes four escalating levels with C# examples: async/await,
Parallel.ForEachAsync,Channel<T>, and Akka.NET Streams, Rx, and Actors - Enforces a preference order: redesign to avoid shared mutable state first, then concurrent collections, then channels, with
lockas a last resort - Designed for .NET developers who are unsure whether a task calls for a simple async pattern or a full actor system
Install
$ npx -y skills add aaronontheweb/dotnet-skills --skill csharp-concurrency-patterns -yInstalls into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.
Files
.NET Concurrency: Choosing the Right Tool
When to Use This Skill
Use this skill when:
- Deciding how to handle concurrent operations in .NET
- Evaluating whether to use async/await, Channels, Akka.NET, or other abstractions
- Tempted to use locks, semaphores, or other synchronization primitives
- Need to process streams of data with backpressure, batching, or debouncing
- Managing state across multiple concurrent entities
Reference Files
- advanced-concurrency.md: Akka.NET Streams, Reactive Extensions, Akka.NET Actors (entity-per-actor, state machines, cluster sharding), and async local function patterns
The Philosophy
Start simple, escalate only when needed.
Most concurrency problems can be solved with async/await. Only reach for more sophisticated tools when you have a specific need that async/await can't address cleanly.
Try to avoid shared mutable state. The best way to handle concurrency is to design it away. Immutable data, message passing, and isolated state (like actors) eliminate entire categories of bugs.
Details
- Repository
- github.com/aaronontheweb/dotnet-skills
- Category
- .NET & C#
More from aaronontheweb/dotnet-skills
All 34- Efcore Patterns1.6K
- Dependency Injection Patterns716
- Database Performance713
- Dotnet Project Structure707
- Api Design703
- Type Design Performance699
- Ilspy Decompile665
- Package Management624
- Microsoft Extensions Configuration622
- Serialization609
- Testcontainers Integration Tests598
- Dotnet Slopwatch595
- Crap Analysis594
- Playwright Blazor Testing572
- Dotnet Local Tools561
- Aspire Integration Testing533
- Mjml Email Templates524
- Aspire Service Defaults508
- Aspire Configuration497
- Snapshot Testing496
- Dotnet Devcert Trust469
- Skills Index Snippets467
- Playwright Ci Caching466
- Akka Net Best Practices461
Similar to Csharp Concurrency Patterns
More .NET & C#
akka-net-best-practicesaaronontheweb/dotnet-skills461 installsBest practices for Akka.NET covering EventStream vs DistributedPubSub, supervision, error handling, and DI-aware Props.
dotnet-patternsaffaan-m/ecc6K installsIdiomatic C# and .NET conventions covering immutability, dependency injection, async/await, and common application patterns.
csharp-asyncgithub/awesome-copilot11.1K installsReview and guidance checklist for C# async code covering naming, return types, exceptions, and pitfalls.
dotnet-backend-patternswshobson/agents19.8K installsMaster C#/.NET patterns for production APIs covering async, DI, EF Core, Dapper, caching, and testing.
async-python-patternswshobson/agents19.1K installsConcise async Python guide covering asyncio fundamentals, concurrency patterns, and sync-versus-async decisions for I/O-bound work.
m07-concurrencyactionbook/rust-skills3.8K installsThread-safety and async guidance for Send/Sync errors, locking choices, and deadlock or race debugging.