- 1. Intro
- 2. Ractors, what and why
- 3. Ruby heap
- 4. Counter, the wrong way
- 5. Atomics
- 6. Counter, the right way
- 7. Containers, Ractors, and GC
- 8. Concurrent HashMap
- 9. Concurrent ObjectPool
- 10. (Naive) Concurrent Queue
- 11. Parallel Test Framework
- 12. A Better Queue
-
- 12.1. Lock Free MPMC Queue
2. 12.2. Adding Blocking Interface
3. 12.3. Marking
4. 12.4. Writing a Web Server
- 13. Conclusion
This story is about concurrent data structures in the context of Ruby. The goal here is to demonstrate how true parallelism can be achieved with global mutable state (which at the time of writing, is not supported by built-in Ruby primitives).
Familiarity with Ruby, Rust, C, (and a bit of other tooling) is nice to have, but hopefully not mandatory.
The repository with code examples can be found on GitHub, to run it you need a relatively new version of Ruby (master branch is probably the best option if you can compile it locally), Rust and C compilers.