Concurrency for !Dummies (Who Don't Get It (...Yet))
summary
Explains that MRI Ruby’s global interpreter lock keeps threads from running CPU-bound Ruby code in parallel (MRI 1.8 vs 1.9/2.x behavior), shows sleeping threads speed up I/O waits but CPU-bound math gets slower, and reports a poker-hand gem that runs 1.3 trillion combinations in 5 minutes single-threaded but rises to 7 minutes when threaded. Demonstrates race conditions fixed with a mutex, contrasts JRuby (JVM threads hitting ~180% CPU for three threads), and outlines alternatives like the actor model and Go-style channels.
AI-written summary · about
chapters (8)
- 0:00Introduction and context
- 2:05Defining concurrency
- 4:40Concurrency vs parallelism
- 9:24Threads and the GVL in Ruby
- 14:58Working with shared state
- 20:51The limits of Ruby threads
- 23:28Advanced concurrency patterns
- 26:38Conclusion and resources
related talks
28mConcurrency for Rubyists
23mParallel Processing With Ruby
42mLook out! Gotchas of Using Threads in Ruby
55mComplex Ruby concepts dummified
33mDear God What Am I Doing? Concurrency and Parallel Processing
36mModern Concurrency Practices in Ruby
38mScaling Ruby with Actors, or How I Learned to Stop Worrying and Love Threads
42mThe Mechanics of Ruby
