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 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access