RubyKaigi 2017
How to write synchronization mechanisms for Fiber

How to write synchronization mechanisms for Fiber
Masatoshi SEKI • September 18, 2017 • Hiroshima, Japan

RubyKaigi2017
http://rubykaigi.org/2017/presentations/m_seki.html

Ruby threads are amazing, but for some reason they don't seem to be very popular. So I decided I'd try experimenting with programming multiple independent execution flows in a single thread using Fibers.

In this talk, I'll first explain an idiom for easily writing synchronization mechanisms between Fibers. Then I will explain in detail an example which combines a framework abstracting 'select' with the Fiber idiom to achieve blocking-like non-blocking IO. I'll explain this using actual code from examples of timer-based periodic processing and simple TCP/IP server programming, to an over-the-top example running WEBrick on a single thread (using Fiber to handle multiple clients synchronously). I'll also explain ways to combine this with threads.

In the talk I'd like to present the following: * an example of select abstraction * some essential features for Fibers

RubyKaigi 2017

Explore all talks recorded at RubyKaigi 2017
+59