Concurrency in Ruby 1.9

Posted by Peter J. Jones on

Ruby 1.9 introduced an additional concurrency mechanism called Fibers. If you haven’t played with Fibers or still haven’t discovered Ruby continuations William Morgan has written an article that you might want to take a look at:

Ruby 1.9 has both fibers and continuations. The two are often mentioned in the same breath. They do vaguely similar-sounding things, and are implemented in Ruby 1.9 with similar mechanics underneath the hood, much as how continuations and threads were implemented with the same underlying mechanics in Ruby 1.8.

Another way to deal with concurrency is with the Actor Model. Mike Perham demonstrates the Actor Model built into Rubinius in his article on concurrency. He also points to other resources for using the Actor Model in Ruby.

About the Author

Peter J. Jones has been using Ruby professionally since 2005 and is the author of Effective Ruby: 48 Specific Ways to Write Better Ruby. He speaks at Ruby events from time to time and teaches several Ruby-related workshops. Peter can be reached through our contact page or his twitter account.