aaronontheweb avatar

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
View on GitHub

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 lock as 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 -y

Installs 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

Similar to Csharp Concurrency Patterns

More .NET & C#