Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
81 lines (57 sloc) 1.67 KB


The last two years have been a personal tour of EventMachine, Fibers and Threads for me as I've toured the ecosystem looking for a developer-friendly, efficient solution for scaling Ruby. Historically Threads have performed poorly in Ruby but guess what? - recent events may change your mind. Now would be a good time to give them a second chance.


Share | Shared Mem| Variables
      | Files     |          
Copy  | Pipes     | ???
      | Sockets   |    
      | Processes | Threads

What goes in the "???" box?


  • Go has "Goroutines"
  • Maps well to distributed model
  • Maps to a pool of threads


  • In Erlang and Scala, it's primary
  • Has a mailbox -- you send it a mesage
  • Thread- or Fiber-backed
  • No locks


  • Comes with Rubinius
  • Works on MRI and JRuby
  • Ping pong example
  • "Hard to understand, use correctly"



  • The presenter's
  • ...actually seems a lot like { ... }

Solutions for concurrency


  • Software Transactional Memory
  • Mutation via transactions
  • Clojure (and Cloby) uses it
  • Does the "ACI" of ACID


  • From Java
  • java.util.concurrent
    • ConcurrentHashMap
    • ConcurrentLinkedQueue


  • Standard actor API
  • Concurrent data scrutctures
  • STM implementations for Ruby

To see

  • Kilim
  • Disruptor
  • Actors in Scala/Concurrency in Erlang
  • Java Concurrency in Practice book
Something went wrong with that request. Please try again.