← Graph

Ractor

concept 10 connections

Ruby's actor-model abstraction ('Ruby actor'). Provides parallel execution across CPU cores without thread-safety concerns because object sharing is restricted: unlike threads, Ractors cannot access objects owned by other Ractors. Still marked experimental in Ruby 4.0 (with a softened warning message committed December 11 that removed only the text, not the experimental flag); hoped to stabilize in Ruby 4.1. Common API: Ractor.new { ... } (must take a block), Ractor#send to deliver a message, Ractor.receive inside the block to dequeue, Ractor#take to block on the Ractor's return value, Ractor.yield inside the block to return a value without exiting, and Ractor.select across multiple Ractors to consume results as they complete. Non-shareable objects (e.g. a plain Hash) cannot be closed over by a non-main Ractor; mitigations are passing via send, .freeze, or Ractor.make_shareable. In Louis's cipher-breaking demo, using Ractors alone was initially slower than a single thread; the breakthroughs were giving each Ractor a different starting frequency key and an increasingly aggressive simulated-annealing cooling strategy so the Ractors collectively covered the search space. Audience reports that Ractors block the caller in ways that make them unsuitable for fire-and-forget GUI-background work; Louis worked around this by having Ractors message a main coordinating Ractor. Practical parallelism does not scale to the full core count — on a 10-core machine Louis settled on 7 Ractors because 10 performed worse. Inspiration per audience: the Erlang actor model.

status
experimental in Ruby 4.0
category
architecture
The core technical subject of the talk.
Question concerns Ractor blocking vs fire-and-forget semantics.
Question about Ractor scaling limits.
about
Ractor concept
Question about the origin of the Ractor model.
Takeaway on Ractor object-sharing semantics.
about
Ractor concept
Takeaway on Ractor stability status.
Takeaway on parallel Ractor strategy.
has_skill
Ractor concept
Talk-depth teaching of Ractor patterns; self-describes as new on the journey.
level: intermediate
concept Ractor
related_to
Actor Model concept
Ractor is Ruby's actor-model abstraction.
concept Ractor
related_to
Erlang tool
Audience member asserts the Ractor model comes from Erlang.

Provenance

Read by
2 extractions