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,
Pongy, and deploy them inside different processes. We will then instruct
Pingy to send a message to
Pongy, as before, and wait until
Pingy returns the
Pongy actor's message. The message exchange will occur transparently, although
Pongy were previously implemented without knowing that they might exist inside separate processes, or even different computers...