Ruby Concurrency


  • Can’t run Ruby code in the same process in multiple threads at the same time
  • But when a thread blocks on I/O, another thread can run
  • For example, you can run multiple HTTP requests in parallel, or multiple database queries in parallel
  • You do need one Ruby process per CPU core. But with multithreading you should not need more than one.


  • You can run separate Ruby processes which can run in parallel
  • Web servers like Puma allow multiple processes


  • Web servers like Puma allow multiple threads
  • Rails has been thread-safe since 2.2


  • Added in Ruby 1.9
  • A coroutine mechanism
  •, yield, resume

Async Fibers/Scheduler

Ractor (previously known as guilds)