Writing concurrent libraries for all Ruby runtimes
summary
A concurrent future is built step by step starting from Ruby mutexes and condition variables then exploiting MRI’s GVL volatile semantics and finally using atomic primitives and a wait list to avoid locks the implementation uses compare-and-set loops, full memory fences, Java synchronized and thread nodes and targets MRI JRuby JRuby+Truffle Rubinius compatibility the final version runs correctly across runtimes and shows JRuby+Truffle microbenchmarks about 15 times faster than MRI while eliminating the last blocking critical section
AI-written summary · about
chapters (10)
- 0:00Start
- 0:47Concurrent Ruby
- 6:41Implementation
- 7:25Simple Background Processing
- 11:41Mri Implementation
- 14:51Performance Improvement
- 16:47Atomic Reference
- 19:41Memory Model
- 21:17Concurrent Synchronization Object
- 31:00Conclusion
related talks
28mConcurrency for Rubyists
38m"Parallel and Thread-Safe Ruby at High-Speed with TruffleRuby"
43mParallel and Thread-Safe Ruby at High-Speed with TruffleRuby
36mModern Concurrency Practices in Ruby
54mConcurrency: Rubies, plural
33mConcurrency for !Dummies (Who Don't Get It (...Yet))
23mParallel Processing With Ruby
23mParallelization of Dynamic Languages - Synchronizing Built-in Collections
