O'Reilly logo

Pragmatic Scala by Venkat Subramaniam

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 13Programming with Actors

We often use multithreading and concurrency when programming complex, time-consuming applications, to improve the response time or performance. Traditional concurrency solutions, sadly, lead to several issues, such as thread safety, race conditions, deadlocks, livelocks, and hard-to-read error prone code. Shared mutability is the number-one culprit.

Avoid shared mutability and you’ve removed so many issues. But how to avoid it? That’s where actors come in. Actors help to turn shared mutability into isolated mutability. Actors are active objects that guarantee mutual exclusion of access. No two threads will ever work on an actor at the same time. Due to this natural self-imposed mutual exclusion, any data stored ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required