Outline updated November 2026

Advanced14 hours delivered over 2-4 daysLive, online or on-site

Request this course

Rust Parallel Programming

Class Duration

14 hours of live training delivered over 2-4 days to accommodate your scheduling needs.

Student Prerequisites

  • Working Rust experience equivalent to Mastering Rust, including traits, generics, and closures
  • A solid understanding of ownership and borrowing
  • Familiarity with threads and basic concurrency concepts in any language
  • Memory-Safe Programming with Rust (smart pointers and interior mutability) or equivalent experience is helpful

Target Audience

  • Systems programmers building high-performance applications
  • Backend developers optimizing compute-intensive workloads
  • Engineers migrating parallel C/C++ code to Rust
  • Developers building real-time data processing pipelines
  • Teams working on scientific computing or simulations

New to Rust? Start with Rust Essentials or Mastering Rust. Memory-Safe Programming with Rust is a good step before this course.

Description

This course teaches Rust developers to write correct, fast parallel and concurrent programs. It starts with Send, Sync, and scoped threads, then covers Rayon, channels, locks, and atomics. Later modules cover memory ordering, lock-free data structures, and async concurrency on Tokio. Students test concurrent code with Loom and Miri. They use the same tools to review AI-generated parallel code, where memory-ordering mistakes are common.

Learning Outcomes

  • Choose threads, Rayon, or async for a given workload.
  • Share data across threads with Send, Sync, and scoped threads.
  • Parallelize CPU-bound work with Rayon and measure the speedup.
  • Build channel pipelines with bounded queues and backpressure.
  • Choose between locks, condition variables, and atomics.
  • Apply memory orderings correctly.
  • Explain the ABA problem and memory reclamation in lock-free code.
  • Write async code on Tokio without blocking the runtime.
  • Test concurrent code with Loom and Miri.
  • Benchmark parallel code with Criterion.
  • Catch data races hidden in AI-generated code.

Training Materials

All students receive comprehensive courseware covering all topics in the course. Courseware is distributed via GitHub in the form of documentation and extensive code samples.

Software Requirements

A free GitHub account, the current stable Rust toolchain via rustup (2024 edition), a nightly toolchain with the Miri component (rustup +nightly component add miri), Visual Studio Code or another supported editor with the rust-analyzer extension, a machine with at least four CPU cores so parallel speedups are measurable, and an AI coding assistant of choice (GitHub Copilot, Cursor, or Claude Code). Linux or macOS is recommended for profiling with perf and flame graphs; Windows works for all other topics. A cloud-based environment can be provided if local installation is restricted.

Training Topics

Concurrency and Parallelism in Rust

  • Concurrency vs. parallelism
  • Amdahl's law and work granularity
  • Threads, Rayon, or async
  • How Send and Sync prevent data races
  • Deadlocks, livelocks, and logic races

Threads and Shared State

  • Spawning threads and JoinHandle
  • Scoped threads with std::thread::scope
  • Arc, Mutex, and RwLock
  • Condition variables and barriers
  • OnceLock and LazyLock
  • Thread-local storage
  • Lock poisoning and lock ordering
  • Avoiding deadlocks
  • parking_lot locks

Data Parallelism with Rayon

  • par_iter, par_iter_mut, and into_par_iter
  • Converting sequential code
  • Parallel map, filter, and reduce
  • Parallel fold and collect
  • Parallel sorting with par_sort
  • par_bridge for ordinary iterators
  • When not to parallelize

Thread Pools and Work Stealing

  • How work stealing works
  • Global and custom thread pools
  • join and scope for divide-and-conquer
  • Pool size and thread naming
  • Rayon alongside async runtimes

Message Passing and Channels

  • std::sync::mpsc channels
  • Crossbeam MPMC channels
  • Bounded and unbounded channels
  • Crossbeam select!
  • Backpressure with bounded queues
  • Pipelines and fan-out/fan-in
  • Tokio mpsc, oneshot, broadcast, and watch

Crossbeam Utilities

  • The Crossbeam crates
  • Work-stealing deques with crossbeam-deque
  • ArrayQueue and SegQueue
  • Backoff and CachePadded
  • Epoch-based reclamation with crossbeam-epoch

Atomics and Memory Ordering

  • AtomicBool, AtomicUsize, and AtomicPtr
  • Relaxed, Acquire, and Release
  • AcqRel and SeqCst
  • Happens-before and fences
  • Compare-and-swap loops
  • Why to avoid user-space spin locks
  • False sharing and cache-line padding
  • Atomics vs. locks

Lock-Free Data Structures

  • Lock-free vs. wait-free
  • A lock-free stack and queue
  • The ABA problem
  • Epochs, hazard pointers, and reference counting
  • Using proven crates

Async Concurrency

  • I/O-bound vs. CPU-bound work
  • Tokio's multi-threaded scheduler
  • tokio::select! and JoinSet
  • Structured cancellation
  • Async closures and async fn in traits
  • spawn_blocking and Rayon for CPU work
  • Async locks and semaphores
  • Streams and futures::Stream

Testing and Verifying Concurrent Code

  • Why concurrency bugs escape tests
  • Exploring interleavings with Loom
  • Structuring code for Loom
  • Finding undefined behavior with Miri
  • ThreadSanitizer
  • Stress and deterministic testing
  • Benchmarking with Criterion
  • Profiling with flame graphs

AI-Assisted Parallel Rust

  • Where AI helps and where it hurts
  • Prompts for memory-ordering questions
  • Miri and Loom as the check
  • Reflexive Arc<Mutex<T>> in parallel code
  • AI-assisted refactors and code review

Private team training

Bring this course to your team

Tell us about your team and we will tailor this outline to your tools, stack, and schedule. Courses can also be combined into a longer program.

  1. Tell us what you needYour tools, stack, team size, and timeline.
  2. We send a proposalA course or program, an outline adjusted to your team, and possible dates.
  3. Your team trains liveOnline or on-site, with courseware for every student.

Prefer to talk? Call +1 434-509-6890 or email help@cloudcontraptions.com.

We reply within 1 business day.

Training partner?