Recap

Actors are single-threaded and communicate with each other by passing messages.

We learned that actors do the following:

  • Make it easy to work with isolated mutability

  • Eliminate synchronization concerns at its root

  • Provide efficient one-way messaging but also provide the less efficient send-and-wait facility

  • Are very scalable; while being single-threaded, they efficiently share a pool of threads

  • Allow us to send messages but also provide typed versions (in Akka) backed by interfaces

  • Allow us to coordinate with other actors using transactions

Although actors provide a powerful model, they also have limitations. There is potential for actor starvation and also deadlock if we’re not careful in designing with them. Also, we have to ensure that ...

Get Programming Concurrency on the JVM now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.