Remote actors
So far in this book, we have mostly concentrated on writing programs on a single computer. Concurrent programs are executed within a single process on one computer, and they communicate using shared memory. Seemingly, actors described in this chapter communicate by passing messages. However, the message passing used throughout this chapter is implemented by reading and writing to shared memory under the hood.
In this section, we study how the actor model ensures location transparency by taking existing actors and deploying them in a distributed program. We take two existing actor implementations, namely, Pingy and Pongy, and deploy them inside different processes. We will then instruct the Pingy actor to send a message to the Pongy actor, as before, and wait until the Pingy actor returns the Pongy actor's message. The message exchange will occur transparently, although the Pingy and Pongy actor's were previously implemented without knowing that they might exist inside separate...