一键导入
m07-concurrency
Mastering C++ Concurrency. Triggers: std::thread, jthread, atomic, mutex, deadlock, race condition, memory model, coroutine, async.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Mastering C++ Concurrency. Triggers: std::thread, jthread, atomic, mutex, deadlock, race condition, memory model, coroutine, async.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
| name | m07-concurrency |
| description | Mastering C++ Concurrency. Triggers: std::thread, jthread, atomic, mutex, deadlock, race condition, memory model, coroutine, async. |
How do threads communicate?
std::mutex) or Atomics (std::atomic).std::condition_variable) or Latches/Semaphores (C++20).std::async or Coroutines (C++20).| Issue | Design Question |
|---|---|
| Data Race | Are two threads accessing memory without a Happens-Before edge? |
| Deadlock | Did you lock Mutex A then B, while another thread locked B then A? |
| False Sharing | Are independent atomics sitting on the same cache line? |
| Live Lock | Are threads spinning without progress? |
Do I need a thread?
std::async or Thread Pool.std::jthread.Is it shared state?
std::mutex.std::atomic.Locks or Atomics?
counter++ is Read-Modify-Write, not atomic. Data race.std::atomic<int>.| Tool | C++ Version | Use When |
|---|---|---|
std::jthread | C++20 | Standard thread (auto-join). |
std::atomic | C++11 | Lock-free counters/flags. |
std::mutex | C++11 | Locking critical sections. |
std::shared_mutex | C++17 | Read-heavy workloads. |
std::latch | C++20 | Waiting for N tasks to start. |
co_await | C++20 | Async I/O (requires library). |
Use when creating skills for C++20 standard library features, language constructs, remote third-party libraries, or local C++ projects. Keywords: create C++20 skill, create std skill C++, create concept skill, create local C++ skill, 创建 C++20 skill, 创建标准库技能, 创建 concept 技能, 本地库生成 skill, 动态 C++ skill, skill for ranges, skill for coroutines, skill for concepts, generate C++ skill from local path, C++20 技能, 从文档创建 skill, from docs create C++ skill
Mastering C++ Ownership: Move Semantics, RAII, and Reference Safety. Triggers: std::move, use-after-free, double-free, dangling pointer, copy elision, RVO, reference qualifiers.
Mastering C++ Smart Pointers: unique_ptr, shared_ptr, weak_ptr. Triggers: memory management, cycles, enable_shared_from_this, make_unique, make_shared, custom deleters.
Mastering C++ Const Correctness and Mutability. Triggers: const, mutable, logically const, bitwise const, data race, mutex, shared_mutex, thread safety.
Mastering C++ Polymorphism: Templates, Concepts, and Virtual Functions. Triggers: templates, concepts, vtable, CRTP, static polymorphism, dynamic polymorphism, SFINAE.
Mastering C++ Type-Driven Design. Triggers: strong types, phantom types, type state pattern, builder pattern, invalid state unrepresentable.