csharp-async-await-threading
/csharp-async-await-threading
Use this skill when managing asynchronous operations, cancellation tokens, Channel<T> queues, and Task parallelization in .NET.
- Author
- nextboxis ↗
- Repository
- library-skill-agents ↗
- Licence
- MIT
- Last repository change
- 28.10.2026
Assessment and security
- Files in this package
- 1
- Scripts
- 0
- HTML comments
- 0
- URLs in SKILL.md
- 0
No signals detected. Repository changed on 28.10.2026, without references to retired models or APIs.
MIT, open: use and modify while retaining author attribution.
What it does and when to use it
Use this skill when managing asynchronous operations, cancellation tokens, Channel<T> queues, and Task parallelization in .NET.
Original author description
Use this skill when managing asynchronous operations, cancellation tokens, Channel<T> queues, and Task parallelization in .NET.
How it works
- When to use
- Prerequisites
- Step-by-step workflow
- Commands / code examples
- Common mistakes & pitfalls
- Verification checklist
- Related skills
SKILL.md preview
---
name: csharp-async-await-threading
description: Use this skill when managing asynchronous operations, cancellation tokens, Channel<T> queues, and Task parallelization in .NET.
---
# C# Async/Await & Thread Synchronization
## When to use
Use this skill when you need to managing asynchronous operations, cancellation tokens, Channel<T> queues, and Task parallelization in .NET.
## Prerequisites
- Working knowledge of relevant programming language or database fundamentals.
- Access to testing environment or local runtime instance.
## Step-by-step workflow
1. **Analyze operational requirements**: Review performance boundaries, data integrity constraints, and query patterns.
2. **Design schema / interface**: Define explicit data contracts, types, or indexes supporting planned operations.
3. **Implement core routines**: Construct declarative, type-safe, or parameterized queries and functions.
4. **Validate performance**: Verify execution metrics using profilers, EXPLAIN plans, or benchmark test suites.
5. **Implement defensive controls**: Enforce timeout boundaries, connection pooling limits, and transaction safety.
## Commands / code examples
```csharp
using System;
using System.Threading;
using System.Threading.Channels;
using System.Threading.Tasks;
public class EventPipeline {
private readonly Channel<string> _channel = Channel.CreateBounded<string>(100);
public async Task PublishAsync(string msg, CancellationToken ct) {
await _channel.Writer.WriteAsync(msg, ct);
}
public async Task ConsumeAsync(CancellationToken ct) {
await foreach (var item in _channel.Reader.ReadAllAsync(ct)) {
Console.WriteLine($"Processed: {item}");
}
}
}
```
## Common mistakes & pitfalls
- Overlooking indexing strategies on foreign keys and frequently queried filter columns.
- Running unparameterized dynamic queries, creating severe SQL injection vulnerabilities.
- Holding open long-running database transactions during slow external network calls.
## Verification checklist
- [ ] Schema contracts and type signatures are strictly enforced.
- [ ] Queries are fully parameterized against injection vulnerabilities.
- [ ] Profiling or execution plans show optimal resource consumption.
- [ ] Error handling safely releases locks and rolls back aborted transactions.
## Related skills
- postgresql-query-optimization-explain
- sql-anti-patterns-remediation
- acid-transactions-isolation-levels
- secure-code-review-static-analysis-sast
Versions
The database has no other skills named csharp-async-await-threading.
Database snapshot: 13.11.2026 · package version 5899b713fa34 (SHA-256 digest of the entire package)
Downloads in the last 30 days: 0 · ranking
Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.
Similar skills
- 91csharp-async-patterns
Use when C# async/await patterns including Task, ValueTask, async streams, and cancellation. Use when writing asynchronous C# code. - 100csharp-expert
Expert-level C# development with .NET 8+, ASP.NET Core, LINQ, async/await, and enterprise patterns. Use when the user mentions C#, .NET, ASP.NET, enterprise, or Microsoft platforms, or when the task involves Modern C#, Async/Await, LINQ, or ASP.NET Core. - 95csharp-async-patterns
Use when C# asynchronous programming with async/await, Task, ValueTask, ConfigureAwait, and async streams for responsive applications. - 100csharp-pro
Write modern C# code with advanced features like records, pattern matching, and async/await. Use for version-compatible .NET implementation and evidence-based testing/performance review. - 90csharp-pro
Write modern C# code with advanced features like records, pattern matching, and async/await. Optimizes .NET applications, implements enterprise patterns, and ensures comprehensive testing. Use for C# refactoring, performance optimization, or complex .NET solutions. - 100csharp-dotnet
Use when building on .NET 8+ with C# 12. Covers nullable reference types, records, async/await correctness, minimal APIs, dependency injection, and EF Core query performance. Trigger on "async deadlock in my asp.net app", "turn on nullable reference types", "ef core is doing n+1…