Dear God What Am I Doing? Concurrency and Parallel Processing
summary
Shows concrete experiments and gotchas: fetching 100 Google pages goes from 45s→8s when moving from naive sequential to a thread pool but adding more threads yields diminishing returns; CPU-bound hashing stalls under GIL blocks CPU-bound threads in MRI whereas JRuby/Rubinius allow true parallelism; combining multi-process + threads gives the best throughput; a real bug: Ruby stdlib Queue with Queue.empty deadlock unless you use pop correctly; demos use threads, fork, Celluloid (and DCell/Celluloid::IO) and mostly work with fixes noted.
AI-written summary · about
chapters (31)
- 0:00Introduction
- 1:29Threads and forks
- 1:53Machine architecture
- 5:21Primitives
- 6:32Interpreters
- 7:11Thread
- 8:46Shared Memory
- 11:46IPC
- 11:59Fibers
- 13:07Multithreaded
- 13:29Sequential
- 13:40Q
- 14:09Using more threads
- 14:30Performance
- 15:03Overhead
- 15:16Math
- 15:49Queue
- 16:19Global Interpreter Lock
- 17:32JRuby
- 17:51Multiprocess
- 19:25Instantiating Threads
- 19:42Interprocess communication
- 20:38Simple examples
- 21:17Complex examples
- 21:35Queue example
- 23:26wrap empty
- 24:27rubyhero
- 25:03celluloid
- 26:08vent machine
- 26:41monitoring
- 27:37making Ruby faster
related talks
23mParallel Processing With Ruby
28mConcurrency for Rubyists
42mLook out! Gotchas of Using Threads in Ruby
33mConcurrency for !Dummies (Who Don't Get It (...Yet))
20mSubprocesses, Threads and Fibers
36mModern Concurrency Practices in Ruby
27mIn-Depth Ruby Concurrency: Navigating the Ruby concurrency landscape
26mConcurrency in Ruby: From fork() to Fiber
