@kyanny's blog

My life. Opinions are my own.

Book: Working With Ruby Threads

I am a fan of "Working With ~" series wirtten by Jesse Storimer. I read Working With Ruby Threads. This book describes concurrency in Ruby world.

Semantically, this book has three parts.

In the first part, author defines difference of concurrency and parallelism. I'm not sure whether this definition is general or not, but clear definition for ambiguous words makes this book easy to understand.

Second part is tour of low-level thread APIs such as Thread, Mutex and Condition Variable. One of the most important thing I learned from this book is "Don't use low-level thread APIs by myself". It's too difficult to use properly.

Last part is example of Ruby's concurrency in read world. Author introduces Celluloid, an actor-style concurrent framework. Even though there is not so many codes, it's enough to give a basic knowledge of it. He also explains Puma's thread pool implementation. This is more complex than Ceclluloid basis.

After reading this book, I'm interesting more about concurrency in Ruby. I read a few lines of code of Ceclluloid and changed default ruby interepreter of my machine to Rubinius. My first contribution for Rubinius was fizzled out, but I wish to keep in touch.