Learn Ruby's threading model: creating threads, synchronization with Mutex and Queue, avoiding deadlocks, and understanding the GVL.
Tutorial series
Ruby Concurrency
6 tutorials — follow in order for the best learning path.
- Threads Basics in Ruby
- Mutexes and Synchronization in Ruby
Safely coordinate threads in Ruby using Mutex, Queue, and ConditionVariable to prevent race conditions and build producer-consumer pipelines.
- Fiber Basics in Ruby
Learn Ruby's Fiber class for cooperative concurrency. Master pause-resume control flow with Fiber.yield, Fiber.resume, and Fiber#transfer.
- Ractor Introduction in Ruby
Learn Ruby's Ractor — a true parallelism model introduced in Ruby 3.0. Understand actor-model message passing and memory isolation without mutexes.
- The Async Gem in Ruby
Handle thousands of concurrent I/O operations in Ruby with fibers and the async gem's reactor-based event loop.
- The concurrent-ruby Library
Learn how concurrent-ruby simplifies thread-safe collections, async futures, actors, and synchronization primitives for production Ruby apps.