~/talk

Introduction to Concurrency in Ruby

Talkat RailsConf 2016 · 2016-05-04..05-06· [ruby]
slides:none on file

Builds a tiny Slack‑like chat server and implements it three ways so differences are concrete: multi‑process with fork and pipes (Unicorn style), multi‑thread with a shared messages array and a mutex (watch for deadlocks and the GIL), and evented using Fiber and IO.select (EventMachine‑style tradeoffs). Shows why Puma/Unicorn/ActionCable make different choices, measures memory and threading behavior on a laptop, and demos each version — the evented and threaded ones run; the multi‑process approach is the most fragile.

AI-written summary · about

  1. 0:00Start
  2. 2:40Our chat client
  3. 5:33Communicate between processes
  4. 6:46Start a worker process
  5. 8:34What's running in the worker process
  6. 11:59Start a TCP server (exactly the same)
  7. 12:11Store incoming messages
  8. 13:46Run a thread per connection
  9. 14:47Store a message
  10. 15:21Send messages to the client
  11. 20:49The mental model...
  12. 23:50Fibers
  13. 25:42The client representation
  14. 27:04Structure of the event loop
  15. 27:42Accept incoming connections
  16. 28:36Read from readable connections
  17. 28:49Write to writable connections
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.