Rails 4 and the Future of Web
summary
MRI still has a global VM lock so CPU-bound Fibonacci threads show no speedup (about 5.7s on the demo machine) while IO-bound threads halve latency by releasing the lock; Rails 4 removes config.threadsafe by preloading and caching classes, disables dependency loading and strips the rack lock so threaded servers (Puma or multiprocess setups) actually run concurrently; action_controller_live exposes a streaming IO, demonstrated by a live-reload using server-sent events, fs_events and a DRb hook inside the same process.
AI-written summary · about
chapters (25)
- 0:00Start
- 10:32Recursive Fib()
- 12:16What do we do?
- 12:48Slow Server
- 15:06GVL Magic
- 19:59threadsafe!
- 22:59Rack::Lock
- 28:36check then act
- 29:20Fix #1 (eager init)
- 29:47Fix #2 (locking)
- 30:24Lazy Object
- 30:35Maintain API
- 31:38Fix #1 (lock)
- 33:30Global Variables
- 34:01Class methods
- 36:03Rack Encourages Buffering
- 37:26Example
- 38:20Rack API
- 39:08Threaded action
- 39:54Blocking Buffer
- 40:41View Source
- 40:58Control Output
- 41:54SSE Response
- 42:18Client Side
- 44:04FS Events








