Exploring Ruby Ractors :: jpterry.com
29-Mar-2025 15
I set out today for a silly explore hoping to waste some CPU with a whole bunch of ractors doing math, but I find that YJIT is pretty amazing.
Ruby 3.0.0 came out in December 2020, more than 4 years ago now, and with it came Ractors (and Fiber Scheduler but that’s another episode). Ractors promised a way to run truly concurrent things within the same ruby process. Ruby has a problem with lots of things being shared and the GVL essentially protects those shared accesses. With ractors, you can run code that is only allowed to share with other ractors in very specific ways. This allows multiple ractors to run code concurrently, as though there were multiple, per-ractor, GVLs.
I found myself with some time to spare and wanted to see where Ractors stood in the most recent stable ruby version, 3.4.2. Here’s what I discovered.
Exploring Ruby Ractors :: jpterry.com #ruby #rubydeveloper #rubyonrails #Exploring #Ractors #jpterry.com https://rubyonrails.ba/link/exploring-ruby-ractors-jpterry-com