Learning Concurrent Programming in Scala

Dive into the Scala framework with this programming guide, created to help you learn Scala and to build intricate, modern, scalable concurrent applications

Learning Concurrent Programming in Scala

This ebook is included in a Mapt subscription
Aleksandar Prokopec

4 customer reviews
Dive into the Scala framework with this programming guide, created to help you learn Scala and to build intricate, modern, scalable concurrent applications
$0.00
$26.99
$44.99
$29.99p/m after trial
RRP $26.99
RRP $44.99
Subscription
eBook
Print + eBook
Start 30 Day Trial
Subscribe and access every Packt eBook & Video.
 
  • 4,000+ eBooks & Videos
  • 40+ New titles a month
  • 1 Free eBook/Video to keep every month
Start Free Trial
 
Preview in Mapt

Book Details

ISBN 139781783281411
Paperback366 pages

Book Description

This book will give you an insight into the best practices necessary to build concurrent programs in Scala using modern, high-level concurrency libraries. It starts by introducing you to the foundations of concurrent programming on the JVM, outlining the basics of the Java Memory Model, and then shows some of the classic building blocks of concurrency, such as the atomic variables, thread pools, and concurrent data structures, along with the caveats of traditional concurrency. It then walks you through different high-level concurrency abstractions, each tailored toward a specific class of programming tasks. Finally, the book presents an overview of when to use which concurrency library and demonstrates how they all work together.

Table of Contents

Chapter 1: Introduction
Concurrent programming
The advantages of Scala
Preliminaries
Summary
Exercises
Chapter 2: Concurrency on the JVM and the Java Memory Model
Processes and Threads
Monitors and synchronization
Volatile variables
The Java Memory Model
Summary
Exercises
Chapter 3: Traditional Building Blocks of Concurrency
The Executor and ExecutionContext objects
Atomic primitives
Lazy values
Concurrent collections
Creating and handling processes
Summary
Exercises
Chapter 4: Asynchronous Programming with Futures and Promises
Futures
Promises
Futures and blocking
The Scala Async library
Alternative Future frameworks
Summary
Exercises
Chapter 5: Data-Parallel Collections
Scala collections in a nutshell
Using parallel collections
Caveats of parallel collections
Using parallel and concurrent collections together
Implementing custom parallel collections
Alternative data-parallel frameworks
Summary
Exercises
Chapter 6: Concurrent Programming with Reactive Extensions
Creating Observable objects
Composing Observable objects
Rx schedulers
Subjects and top-down reactive programming
Summary
Exercises
Chapter 7: Software Transactional Memory
The trouble with atomic variables
Using Software Transactional Memory
Composing transactions
Retrying transactions
Transactional collections
Summary
Exercises
Chapter 8: Actors
Working with actors
Communication between actors
Actor supervision
Remote actors
Summary
Exercises
Chapter 9: Concurrency in Practice
Choosing the right tools for the job
Putting it all together – a remote file browser
Debugging concurrent programs
Summary
Exercises

What You Will Learn

  • Get to grips with the fundamentals of concurrent programming on modern multiprocessor systems, with a particular focus on the JVM concurrency model
  • Build high-performance concurrent systems from simple, low-level concurrency primitives
  • Express asynchrony in concurrent computations with futures and promises
  • Seamlessly accelerate sequential programs by using data-parallel collections
  • Implement reactive and event-based programs declaratively with Rx-style event streams
  • Design safe, scalable, and easy-to-comprehend in-memory transactional data models
  • Transparently create distributed applications that scale across multiple machines
  • Choose the correct concurrency abstraction and integrate different concurrency frameworks together in large applications

Authors

Table of Contents

Chapter 1: Introduction
Concurrent programming
The advantages of Scala
Preliminaries
Summary
Exercises
Chapter 2: Concurrency on the JVM and the Java Memory Model
Processes and Threads
Monitors and synchronization
Volatile variables
The Java Memory Model
Summary
Exercises
Chapter 3: Traditional Building Blocks of Concurrency
The Executor and ExecutionContext objects
Atomic primitives
Lazy values
Concurrent collections
Creating and handling processes
Summary
Exercises
Chapter 4: Asynchronous Programming with Futures and Promises
Futures
Promises
Futures and blocking
The Scala Async library
Alternative Future frameworks
Summary
Exercises
Chapter 5: Data-Parallel Collections
Scala collections in a nutshell
Using parallel collections
Caveats of parallel collections
Using parallel and concurrent collections together
Implementing custom parallel collections
Alternative data-parallel frameworks
Summary
Exercises
Chapter 6: Concurrent Programming with Reactive Extensions
Creating Observable objects
Composing Observable objects
Rx schedulers
Subjects and top-down reactive programming
Summary
Exercises
Chapter 7: Software Transactional Memory
The trouble with atomic variables
Using Software Transactional Memory
Composing transactions
Retrying transactions
Transactional collections
Summary
Exercises
Chapter 8: Actors
Working with actors
Communication between actors
Actor supervision
Remote actors
Summary
Exercises
Chapter 9: Concurrency in Practice
Choosing the right tools for the job
Putting it all together – a remote file browser
Debugging concurrent programs
Summary
Exercises

Book Details

ISBN 139781783281411
Paperback366 pages
Read More
From 4 reviews

Read More Reviews