In the past, Ruby's concurrency story was rough. But over the last few years, the community has done a ton of work to improve the status quo. Unfortunately, due to the myriad of fast-moving changes and new options, there's been FUD and common misconceptions, leaving some people in the dark.
This book will help you get the story straight when it comes to multi-threaded concurrency in Ruby.
Stuff you'll learn from this book
- What's really at stake when your code isn't thread-safe?
- What exactly is the GIL, and how does it affect your code?
- Why are people so excited about JRuby when it comes to multi-threaded Ruby code?
- The differences between concurrency and parallelism.
- The
ThreadAPI supported by all major Ruby implementations. - How many threads you should use for a given task.
- How to spot code that violates thread-safety, and make sure yours doesn't.
- The utility classes for working with threads that ship with Ruby's standard library.
- Wrapping abstractions around your threads, a la the Actor model.
- Different ways of structuring your multi-threaded code to make it easier to reason about, or improve efficiency.
- How to think about concurrency. This kind of knowledge applies to more than just Ruby, and will be valuable for years to come.
- And much more...