concurrency-patterns

Diagnose and fix concurrency bugs across Java, Kotlin, Python, Go, and Rust.

5|1|Updated Jun 17, 2026
One-click install
npx skills add https://github.com/roanbrasil/engineer-grade-agent-skills --skill concurrency-patterns-roanbrasil
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: concurrency-patterns
Source: https://github.com/roanbrasil/engineer-grade-agent-skills/tree/main/skills/concurrency-patterns
Command: npx skills add https://github.com/roanbrasil/engineer-grade-agent-skills --skill concurrency-patterns-roanbrasil

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Concurrency bugs like race conditions, deadlocks, and livelocks are notoriously hard to debug, and selecting the wrong concurrency model for your workload can lead to poor performance, resource starvation, or unstable production systems. This Skill eliminates that guesswork by providing proven, language-specific patterns for building safe, efficient concurrent systems across Java, Kotlin, Python, Go, and Rust.

Core Features & Use Cases

  • Workload-aligned concurrency model selection: Clear guidance to pick the right concurrency model (shared memory, actor model, async/await, CSP channels, data parallelism) for CPU-bound, I/O-bound, or pipeline processing workloads.
  • Language-specific implementation patterns: Ready-to-use, idiomatic code patterns for Java/Kotlin locks, atomics, virtual threads, and Akka actors; Python threading, multiprocessing, and asyncio; Rust Arc<Mutex>, channels, Rayon, and tokio; and Go channels.
  • Bug prevention and remediation: Step-by-step fixes for common concurrency problems (race conditions, deadlocks, false sharing, starvation) and a curated list of anti-patterns to avoid, plus a production-ready concurrency checklist to validate implementations before release.
  • Use Case: For example, use this Skill to implement a high-throughput I/O service in Java 21 with virtual threads that avoids the complexity of reactive programming, or build a parallel data processing pipeline in Rust using Rayon that safely utilizes all available CPU cores.

Quick Start

Use the concurrency-patterns skill to implement a deadlock-free, high-throughput concurrent data processing pipeline for your Java service using virtual threads and bounded thread pools.

Frequently Asked Questions about concurrency-patterns

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I fix race conditions and deadlocks in multi-threaded code?

Fix race conditions and deadlocks by applying deterministic, lock-free atomic operation patterns and language-specific guardrails. This provides step-by-step remediation for concurrency bugs across shared memory, async, and actor model workloads.

When should I use the actor model versus CSP channels for parallel processing?

Use the actor model for distributed state management with supervision strategies, and CSP channels for pipeline processing workloads. Workload-aligned model selection ensures optimal concurrency architecture for CPU-bound or I/O-bound tasks.

How do I implement high-throughput I/O services in Java 21 using virtual threads?

Implement high-throughput I/O services in Java 21 using virtual threads to avoid reactive programming complexity. This approach utilizes bounded thread pools to handle massive concurrency without traditional platform thread limitations.

Does this concurrency guidance support Rust Arc<Mutex> and Rayon for parallel data pipelines?

Yes, concurrency guidance supports Rust Arc<Mutex>, channels, Rayon, and tokio. It provides idiomatic implementation patterns to safely utilize all available CPU cores for parallel data processing pipelines.

What is the best way to avoid false sharing and starvation in async programming?

Avoid false sharing and starvation by following curated anti-patterns and a production-ready concurrency checklist. This validates implementations before release to ensure stable resource utilization across multi-threaded workloads.

Can I use Python asyncio and multiprocessing together for concurrent workloads?

Yes, you can use Python threading, multiprocessing, and asyncio together. The skill provides language-specific implementation patterns to align your concurrency model with CPU-bound or I/O-bound workload requirements.