csharp-concurrency-patterns

Installation
Summary

Navigate .NET concurrency from async/await through Channels to Akka.NET based on your specific problem.

  • Start with async/await for I/O-bound work; escalate only when you hit a concrete limitation that simpler tools can't address cleanly
  • Use Parallel.ForEachAsync for CPU-bound parallelism, Channel<T> for producer/consumer decoupling with backpressure, and Reactive Extensions for UI event composition
  • Akka.NET Actors handle stateful entity management, state machines with Become(), and distributed scenarios; Akka.NET Streams provide server-side batching and throttling
  • Avoid locks, manual thread creation, and blocking on async code; prefer immutability, message passing, and System.Collections.Concurrent when shared state is unavoidable
SKILL.md

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

Related skills
Installs
967
GitHub Stars
923
First Seen
Jan 28, 2026