Chapter 34


Back in chapter 21 we explored the concepts of multithreading and looked at both the foundation concepts as well as several easier ways to get our programs to utilize multiple threads. The reality of the situation is that programs need to be multithreaded to take full advantage of modern processors, even on mobile devices like tablets and smartphones. The addition of parallel collections in Scala 2.9 makes it remarkably easy to parallelize programs as long as they fit the model of having multiple pieces of data that can be operated on independently. If you code in a completely functional way with no mutable data, it is also possible to break work across many threads with little challenge.

Unfortunately, not all problems are ...

Get Introduction to the Art of Programming Using Scala now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.