Skip to content
Back to skills

Concurrency

ASecurity

Detect and fix race conditions and deadlocks. Fires thousands of concurrent requests to prove thread-unsafety, then applies the minimal synchronization primitive needed.

  • 2 stars
  • 0 votes
  • 0 copies
  • 3 views
  • Added May 26, 2026
development

Security analysis

A100/100

Scanned May 27, 2026

npx -y skills add v0idOS/performance-deity --skill concurrency --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Concurrency?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Concurrency
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/v0idos-concurrency/badge)](https://www.skillsdirectory.com/skills/v0idos-concurrency)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
description: Detect and fix race conditions and deadlocks. Fires thousands of concurrent requests to prove thread-unsafety, then applies the minimal synchronization primitive needed.
---

Execute all four phases in order.

## Phase 1 — Chaos Script

Write a test that fires ≥1,000 concurrent async requests or threads at the target function simultaneously. The test must assert the final state deterministically (e.g. if a counter is incremented 1,000 times, assert `counter === 1000`).

## Phase 2 — Failure Verification

Run the test. If it passes consistently:
- Increase concurrency to 10,000.
- Add `sleep()` calls mid-execution to force thread context switching.

Prove the function is unsafe before fixing it. Do not add synchronization to code that has not been shown to fail.

## Phase 3 — Synchronization

Implement the minimal synchronization primitive needed (prefer in this order):
1. Atomic operations (e.g. `Atomics.add`, `atomic.AddInt64`, `std::atomic`)
2. Mutex / Lock with the smallest possible critical section
3. Semaphore only if mutual exclusion alone is insufficient

Do not hold a lock across any I/O operation.

## Phase 4 — Report

Re-run the test with 10,000 concurrent requests. Report the pass/fail counts.

| Metric | Before | After |
|---|---|---|
| Failures at 1k concurrent | N | 0 |
| Failures at 10k concurrent | N | 0 |

The target is 0 failures.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in development →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.