This chapter presented the traditional building blocks of concurrent programs in Scala. We saw how to use Executor
objects to run concurrent computations. We learned how to use atomic primitives to atomically switch between different states in the program and implement locks and lock-free algorithms. We studied the implementation of lazy values and their impact on concurrent programs. We then showed you important classes of concurrent collections and learned how to apply them in practice, and we concluded by visiting the scala.sys.process
package. These insights are not only specific to Scala; but most languages and platforms also have concurrency utilities that are similar to the ones presented in this chapter.
Many other Java concurrency APIs are thoroughly explained in the book Java Concurrency in Practice, by Brian Goetz, Tim Peierls, Joshua Bloch, Joseph Bowbeer, David Holmes, and Doug Lea. To learn more about concepts such as lock-freedom, atomic variables, various types of...