Skip to content
aj-geddes avatar

Concurrency Patterns

Thread-safe concurrency primitives and patterns for parallel work, with reference implementations in TypeScript, Node.js, and Python.

CCM score
38 of 100
skills.sh installs
479
GitHub stars
396
last updated
Aug 21, 2026
View on GitHub

Own this skill? Claim it

What it does

  • Covers promise pools, mutex and semaphore implementations, worker pools, Python threading, and asyncio patterns
  • Includes six reference guides in a references/ directory, from a TypeScript promise pool to Go-style channels simulated in code
  • Enforces concurrency limits, error handling in parallel operations, and cleanup of resources, while warning against polling and blocking event loops
  • Designed for multi-threaded applications, parallel data processing, race condition prevention, and worker pool systems

Install

$ npx -y skills add aj-geddes/useful-ai-prompts --skill concurrency-patterns -y

Installs into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.

Files

Concurrency Patterns

Table of Contents

Overview

Implement safe concurrent code using proper synchronization primitives and patterns for parallel execution.

When to Use

  • Multi-threaded applications
  • Parallel data processing
  • Race condition prevention
  • Resource pooling
  • Task coordination
  • High-performance systems
  • Async operations
  • Worker pools

Quick Start

Minimal working example:

class PromisePool {
  private queue: Array<() => Promise<any>> = [];
  private active = 0;

  constructor(private concurrency: number) {}

  async add<T>(fn: () => Promise<T>): Promise<T> {
    while (this.active >= this.concurrency) {
      await this.waitForSlot();
    }

    this.active++;

    try {
      return await fn();
    } finally {
      this.active--;
    }
  }

Details

Repository
github.com/aj-geddes/useful-ai-prompts
Categories
Backend & APIs, Python
First seen
Jun 3, 2026

Questions

What does the concurrency-patterns skill do?

The concurrency-patterns skill guides an agent to implement thread-safe code, mutexes, semaphores, async/await patterns and concurrent data structures. It covers parallel operations, race conditions and high-performance concurrent systems, with examples such as a TypeScript promise pool and Python asyncio patterns.

Who should use the concurrency-patterns skill?

Developers building multi-threaded applications, parallel data processing, resource pools or worker pools will find the concurrency-patterns skill useful. It also suits anyone who needs to prevent race conditions or coordinate async tasks in high-performance systems.

How do I install the concurrency-patterns skill?

Run npx -y skills add aj-geddes/useful-ai-prompts --skill concurrency-patterns -y in your project. Once installed, the concurrency-patterns skill lets the agent apply synchronization primitives and concurrency reference guides when it handles parallel work.

Where does the concurrency-patterns skill sit in the Backend & APIs category?

The concurrency-patterns skill is listed in the Backend & APIs category on Claude Marketplaces, alongside entra-app-registration, neon, firebase-basics, firebase-auth-basics and workers-best-practices. Its own focus is synchronization primitives and async patterns for parallel execution.

More from aj-geddes/useful-ai-prompts

All 258

Similar to Concurrency Patterns

More Backend & APIs