Asynchronous Message Passing in JR
We've now covered the basic synchronization systems (semaphore, monitors) and we know how to declare operations and capabilities . It's time to go to an other form of synchronization : Message Passing. In this post, we'll focus in Asynchronous Message Passing, we'll cover later, the synchronous message passing system with RendezVous.
When we use message passing, the threads doesn't share datas anymore, they share channels. You can see channels like an abstraction of a network between several processes. The processes will send messages to other and the other will wait for receive a message. Normally, with that form of synchronization, the channels are the only objects shared between the threads. So you doesn't need to share memory. That makes possible to distribute the processes across several virtual machines or computers, of course, this also works on a simple computer, like any other program. In message passing, we often see models with several clients and a server that manage the messages.