Rust Concurrency

Concurrency and async programming expert. Handles Send, Sync, threads, async/await, tokio, channels, Mutex, RwLock, deadlock prevention, and race condition debugging.

49 stars 7 forksSoftware Development

Install

skills CLI (Claude Code, Cursor, Codex and more)
npx skills add huiali/rust-skills --skill rust-concurrency
Manual install
git clone --depth 1 https://github.com/huiali/rust-skills.git /tmp/rust-skills
mkdir -p ~/.claude/skills
cp -r /tmp/rust-skills/.codex/skills/rust-concurrency ~/.claude/skills/rust-concurrency

Personal skills live in ~/.claude/skills. Use .claude/skills in a project folder to share a skill with your team.

From the SKILL.md

## Concurrency vs Async

| Dimension | Concurrency (threads) | Async (async/await) |
|-----------|----------------------|---------------------|
| Memory | Each thread has separate stack | Single thread reused |
| Blocking | Blocks OS thread | Doesn't block, yields |
| Use case | CPU-intensive | I/O-intensive |
| Complexity | Simple and direct | Requires runtime |

**Key Insight**: Threads for parallelism, async for concurrency.

## Send/Sync Quick Reference

### Send - Can Transfer Ownership Between Threads

```
Basic types → automatically Send
Contains references → automatically Send
Raw pointers → NOT Send
Rc → NOT Send (non-atomic ref counting)
```

**Rule**: If all fields are Send, the type is Send.

### Sync - Can Share References Between Threads

```
&T where T: Sync → automatically Sync
RefCell → NOT Sync (runtime checking not thread-safe)
MutexGuard → NOT Sync (intentionally)
```

**Rule**: `&T` is Send if `T` is Sync.

## Solution Patterns

### Pattern 1: Shared Mutable State

```rust
use std::sync::{Arc, Mutex};

let counter = Arc::new(Mutex::new(0));
let mut handles = vec![];

for _ in 0..10 {
    let counter = Arc::clone(&counter);
    let handle = std::thread::spawn(move || {
        let mut num = counter.lock().unwrap();
        *num += 1;
    });
    handles.push(handle);
}

for handle in handles {
    handle.join().unwrap();
}
```

**When to use**: Multiple threads need to mutate shared data.

**Trade-offs**: Lock contention can limit scalability.
Read the full skill on GitHub

Details

Skill name
rust-concurrency
Path
.codex/skills/rust-concurrency/SKILL.md
License
MIT
Repo updated
9 February 2026

FAQ

What does the Rust Concurrency skill do?

Concurrency and async programming expert. Handles Send, Sync, threads, async/await, tokio, channels, Mutex, RwLock, deadlock prevention, and race condition debugging.

How do I install the Rust Concurrency skill?

skills CLI (Claude Code, Cursor, Codex and more): npx skills add huiali/rust-skills --skill rust-concurrency. Skills go in ~/.claude/skills (personal) or .claude/skills (project), and Claude loads them automatically when a task matches the description.

Is Rust Concurrency popular?

It lives in huiali/rust-skills, which has 49 GitHub stars and 7 forks.

Related skills

Browse the most popular Claude skills, all software development skills, or write your own with the skills generator.