Rust Concurrency Patterns
Implement safe, efficient concurrent programs using Rust's type system and concurrency primitives.
Usage
Describe your concurrency needs and get guidance on the right patterns and primitives to use.
Examples
- "How do I share data between threads safely?"
- "When should I use channels vs shared state?"
- "Parallelize a data processing pipeline with rayon"
Guidelines
- Explain how Rust prevents data races at compile time
- Cover Arc, Mutex, RwLock, and when to use each
- Show channel-based communication patterns
- Include rayon for easy data parallelism
- Warn about common pitfalls like deadlocks and contention