backend-concurrency-mechanics

backend-concurrency-mechanics is a skill for Claude Code, Codex from j4flmao/agent-skills. It costs 68 tokens per session (2,031 once invoked), scanned A, original, MIT.

A technical guide to running many tasks at once using threads, goroutines, and event loops. It explains race conditions, scheduling, and memory barriers, which control how concurrent code shares data safely.

In plain words
What is it for?
Use it to reason about threading models, Go goroutines, event loops, race conditions, scheduling, and safe communication between concurrent tasks.
Why use it?
It helps developers understand why concurrent programs can be difficult to scale or can produce inconsistent results.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to reason about threading models, Go goroutines, event loops, race conditions, scheduling, and safe communication between concurrent tasks.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/j4flmao/agent-skills/concurrency
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add j4flmao/agent-skills --skill concurrency
Clone the repo
git clone --depth 1 https://github.com/j4flmao/agent-skills

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for backend-concurrency-mechanics

README.md
[![agentmods](https://agentmods.dev/badge/skills/j4flmao/agent-skills/concurrency/github.svg)](https://agentmods.dev/skills/j4flmao/agent-skills/concurrency)
Your own site
<a href="https://agentmods.dev/skills/j4flmao/agent-skills/concurrency"><img src="https://agentmods.dev/badge/skills/j4flmao/agent-skills/concurrency/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for backend-concurrency-mechanics

Your own site · 80×15
<a href="https://agentmods.dev/skills/j4flmao/agent-skills/concurrency"><img src="https://agentmods.dev/badge/skills/j4flmao/agent-skills/concurrency.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 68 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,031 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00068 $0.02031
Opus 5.5 $0.00027 $0.00812
Sonnet 5.5 $0.00014 $0.00406
Haiku 4.5 $0.00007 $0.00203

Measured 13d ago against content hash b0ef1b1ebafd, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

backend-concurrency-mechanics scanned grade A with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 13d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

g.Go(func() error { return fetch(ctx, u) }) // Go 1.22+: loop var is per-iteration
skills/backend/universal/concurrency/SKILL.md · 164 lines

How it starts

The opening of the file, as written. The whole thing — 164 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Concurrency Mechanics

Purpose

Pick the right concurrency model for a workload and write shared-state code that is correct under the language's memory model. Most production concurrency bugs come from unsynchronized shared state, blocking an event loop, or unbounded parallelism; this skill targets those.

Agent Protocol

Trigger

Exact user phrases: "race condition", "data race", "goroutine vs thread", "event loop blocking", "memory barrier", "memory model", "mutex vs atomic", "deadlock", "thread pool sizing", "virtual threads", "async vs threads".

Input Context

  • Language/runtime and version (Go, Java 21+, Node.js, Python, Rust, .NET).
  • Workload type: I/O-bound, CPU-bound, or mixed.
  • The shared state or code path that misbehaves; any race detector output.

Output Artifact

Explanation of the execution model plus corrected code. No files unless requested.

Response Format

Model: {OS threads | M:N (goroutines/virtual threads) | event loop}
Workload: {I/O-bound | CPU-bound}
Shared state: {what} -> {mutex | atomic | channel/actor | immutable copy}
Bound: {pool size / semaphore N}
Verify: {go test -race | jcstress | stress test}

Execution Models

Model Examples Scheduling Cost per unit Blocking call behaviour
1:1 OS threads Java platform threads, C++ std::thread, Python threads Kernel scheduler Each thread reserves a stack (commonly 1 MB on Windows, 8 MB virtual on Linux glibc, committed lazily) plus kernel structures Blocks only that thread
M:N user-space Go goroutines, Java 21 virtual threads, Erlang processes Runtime multiplexes many tasks onto a few OS threads Small growable stacks (Go starts at 2 KB) Runtime parks the task; blocking syscalls may pin a carrier thread
Event loop Node.js (libuv), Python asyncio, Netty, Redis command execution Single thread runs callbacks/coroutines when I/O is ready (epoll, kqueue, IOCP) Very cheap per connection Any CPU-heavy or synchronous call stalls every request

Read the full file on GitHub · 164 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 13d ago Changed · +1 lines · -70 tokens per session b0ef1b1ebafd
  2. 1mo ago Changed · +114 lines · +108 tokens per session ec6aea9de848
  3. 2mo ago First seen · 49 lines · 30 tokens per session scan A c2dfbbda0bcc

Subscribe to this mod's changes

backend-concurrency-mechanics is a skill published in the GitHub repository j4flmao/agent-skills (46 stars, last pushed 13d ago), licensed MIT. It adds 68 tokens to every session and 2,031 once invoked, about $0.0003 per session on Opus 5.5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.

Related

backend-concurrency-mechanics compared with skills from other repositories

backend-concurrency-mechanics next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
backend-concurrency-mechanicsj4flmao/agent-skillsSkill4613d agoMITA68Claude Code, Codex
Concurrency Testing PatternsPramodDutta/qaskillsSkill25327d agoMITA25Claude Code, Codex
Async Correctness 非同期処理の正しさ検証s977043/river-reviewSkill8yesterdayMITA95Claude Code
asynciobobmatnyc/claude-mpm-skillsSkill794mo agoMITA32Claude Code
golangMadAppGang/claude-codeSkill2908mo agoMITA38Claude Code
go-concurrency-patternsfindscripter/everything-skillsSkill122d agononeA126Claude Code
golang-backend-developmentmanutej/luxor-claude-marketplaceSkill645mo agononeA28Claude Code