rust-async

Installation
SKILL.md

Concurrency & Async

Thread Safety

Error Cause Fix
Rc<T> cannot be sent between threads Rc is not Send Use Arc
RefCell<T> is not Sync Not thread-safe Use Mutex or RwLock
Cannot mutate through Arc No interior mutability Arc<Mutex<T>> or Arc<AtomicT>

Deadlock Prevention

  • Lock ordering: Always acquire multiple locks in the same order across all threads
  • Self-deadlock: Never lock the same std::Mutex twice (use parking_lot::ReentrantMutex if needed)
  • Scope locks tightly: Drop guards as soon as possible
  • Atomics for primitives: Use AtomicBool/AtomicUsize instead of Mutex<bool>
  • Choose memory order carefully: Relaxed / Acquire / Release / SeqCst

Async Patterns

Installs
3
GitHub Stars
3
First Seen
Feb 9, 2026
rust-async — peixotorms/odinlayer-skills