Fiber in the 10th year
summary
Fiber exists in Ruby 1.9 as a coroutine primitive, used for generators and cooperative schedulers, and the talk lays out concrete implementation steps: initial stack-copy context switching, then using OS primitives like makecontext/swapcontext and Windows Fiber APIs, and finally a pointer-exchange refactor that consolidates fiber state. Measured wins include up to 18x speedup on deep stacks from the OS-primitive approach, about 5% faster on 60k resume/yield iterations after consolidation, and ~30% reduction in some per-fiber metadata. The auto-Fiber proposal makes IO implicitly yield to a global scheduler (no source changes needed) but requires added synchronization and risks hard-to-reproduce bugs.
AI-written summary · about
chapters (7)
- 0:00Introduction
- 1:32What are fibers
- 6:57Fiber use cases
- 14:10History of fibers
- 22:12Fiber implementation
- 30:13Auto fiber proposal
- 34:40Summary and Q&A








