Scala for Data Science by Pascal Bugnion

Scala for Data Science by Pascal Bugnion

Author:Pascal Bugnion [Pascal Bugnion]
Language: eng
Format: epub
Tags: Databases
Publisher: Packt Publishing
Published: 2016-01-27T22:00:00+00:00


Chapter 9. Concurrency with Akka

Much of this book focusses on taking advantage of multicore and distributed architectures. In Chapter 4, Parallel Collections and Futures, you learned how to use parallel collections to distribute batch processing problems over several threads and how to perform asynchronous computations using futures. In Chapter 7, Web APIs, we applied this knowledge to query the GitHub API with several concurrent threads.

Concurrency abstractions such as futures and parallel collections simplify the enormous complexity of concurrent programming by limiting what you can do. Parallel collections, for instance, force you to phrase your parallelization problem as a sequence of pure functions on collections.

Actors offer a different way of thinking about concurrency. Actors are very good at encapsulating state. Managing state shared between different threads of execution is probably the most challenging part of developing concurrent applications, and, as we will discover in this chapter, actors make it manageable.



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.