aaronontheweb avatar

Csharp Concurrency Patterns

This is a decision tree for .NET concurrency that starts with async/await and only escalates when you have a specific need it can't handle. You get a flowchart covering everything from I/O waits to producer/consumer patterns with Channels to entity management with Akka.NET actors. The philosophy is sound: most problems don't need locks or manual synchronization, and shared mutable state is usually a design smell. What makes this useful is the concrete guidance on when each tool fits. If you're reaching for a SemaphoreSlim or spinning up manual threads, this will probably show you a better abstraction. The anti-patterns section alone is worth reading.

skills.sh installs
1.6K
GitHub stars
1.3K
last updated
Aug 21, 2026

Install

$ npx -y skills add aaronontheweb/dotnet-skills --skill csharp-concurrency-patterns --agent claude-code

Installs into .claude/skills of the current project.

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.

Sponsors

Details

Repository
github.com/aaronontheweb/dotnet-skills
Category
.NET & C#

More from aaronontheweb/dotnet-skills

All 34

Recommended

More .NET & C#
1dotnet avatarmcp-csharp-debugdotnet/skillsRun and debug C# MCP servers locally. Covers IDE configuration, MCP Inspector testing, GitHub Copilot Agent Mode integration, logging setup, and troubleshooting626skills.sh installs
2wshaddix avatarmodern-csharp-coding-standardswshaddix/dotnet-skillsWrite modern, high-performance C# code using records, pattern matching, value objects, async/await, Span<T>/Memory<T>, and best-practice API design patterns. Em589skills.sh installs
3wshobson avatardotnet-backend-patternswshobson/agentsMaster C#/.NET backend development patterns for building robust APIs, MCP servers, and enterprise applications. Covers async/await, dependency injection, Entity19.6Kskills.sh installs
4github avatardotnet-best-practicesgithub/awesome-copilotEnsure .NET/C# code meets best practices for the solution/project.16.1Kskills.sh installs
5github avatarnuget-managergithub/awesome-copilotManage NuGet packages in .NET projects/solutions. Use this skill when adding, removing, or updating NuGet package versions. It enforces using `dotnet` CLI for p14.5Kskills.sh installs
6github avatardotnet-design-pattern-reviewgithub/awesome-copilotReview the C#/.NET code for design pattern implementation and suggest improvements.11.7Kskills.sh installs