Thread Safety First!
summary
Demo uses Ruby 2.0 and jruby174 and runs with 200 threads (and sometimes 10) against a shared Set (a Hash derivative) inside the MongoDB Ruby driver. Execution on JRuby sometimes raises can't add a new key into hash during iteration, exposing different semantics across MRI and JRuby. The talk shows fixing it with fine‑grained locking and mutex and condition variable patterns, plus testing across implementations and heavy threading to reproduce race conditions.
AI-written summary · about
chapters (7)
- 0:00Introduction and demo
- 1:37Threading models compared
- 4:02Metaphor for threading
- 6:45Shared state in practice
- 10:16Concurrency primitives
- 14:04Resource management
- 15:47Testing and conclusion
related talks
42mLook out! Gotchas of Using Threads in Ruby
23mParallel Processing With Ruby
28mConcurrency for Rubyists
47mWhat All Rubyists Should Know About Threads
33mConcurrency for !Dummies (Who Don't Get It (...Yet))
38m"Parallel and Thread-Safe Ruby at High-Speed with TruffleRuby"
43mParallel and Thread-Safe Ruby at High-Speed with TruffleRuby
39mJRuby: Insights from Six Years in Production
