13eholder/modern-cpp-skills/m07-concurrency

Claude Code and agent skill by 13eholder/modern-cpp-skills

Trust tier 3
  • community
Source check pending

Checking that the SKILL.md file is still in the repository.

Mastering C++ Concurrency. Triggers: std::thread, jthread, atomic, mutex, deadlock, race condition, memory model, coroutine, async.

Install

npx vskill@latest install 13eholder/modern-cpp-skills/m07-concurrency

SKILL.md

The same SKILL.md was published earlier as 13eholder/modern-cpp-skills/m07-concurrency.

C++ Concurrency

Core Question

How do threads communicate?

  • Shared State: Mutexes (std::mutex) or Atomics (std::atomic).
  • Coordination: Condition Variables (std::condition_variable) or Latches/Semaphores (C++20).
  • Tasks: std::async or Coroutines (C++20).

Error → Design Question

IssueDesign Question
Data RaceAre two threads accessing memory without a Happens-Before edge?
DeadlockDid you lock Mutex A then B, while another thread locked B then A?
False SharingAre independent atomics sitting on the same cache line?
Live LockAre threads spinning without progress?

Thinking Prompt

  1. Do I need a thread?
  • Short task? → std::async or Thread Pool.
  • Long background? → std::jthread.
  1. Is it shared state?
  • Yes? → Protect with std::mutex.
  • Is it small/primitive? → std::atomic.
  1. Locks or Atomics?
  • Logic requiring multiple steps? → Mutex (Atomic is only for single instructions).
  • Simple flag/counter? → Atomic.

Trace Up / Down

  • Trace Up:
  • Issue: "Random update values in counter."
  • Cause: counter++ is Read-Modify-Write, not atomic. Data race.
  • Fix: std::atomic<int>.

Quick Reference

ToolC++ VersionUse When
`std::jthread`C++20Standard thread (auto-join).
`std::atomic`C++11Lock-free counters/flags.
`std::mutex`C++11Locking critical sections.
`std::shared_mutex`C++17Read-heavy workloads.
`std::latch`C++20Waiting for N tasks to start.
`co_await`C++20Async I/O (requires library).

Security

  • Security scanPassed, 100 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

7-day trend score
5

Not refreshed yet.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/13eholder/modern-cpp-skills/m07-concurrency/badge)](https://verified-skill.com/skills/13eholder/modern-cpp-skills/m07-concurrency)

Something wrong with this skill or its page? Tell us.