ABSTRACT

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.