Using scripts to showcase interprocess communication
Interprocess communication (IPC) was introduced in Chapter 5. In this chapter, we will revisit the mechanism that can make use of scripts. To illustrate most of these communication mechanisms, we will build our examples using a model of producer and consumer processes. The producer and consumer share a common interface, where the producer writes some data that’s read by the consumer. IPC mechanisms are usually implemented in distributed systems, built around more or less complex applications. Our examples will use simple Bash scripts (producer.sh
and consumer.sh
), thus mimicking the producer and consumer processes. We hope that the use of such simple models will still provide a reasonable analogy for real-world applications.
Now, let’s look at shared storage, named and unnamed pipes, and sockets IPC mechanisms, all of which we introduced in Chapter 5 but did not cover in detail.
Shared storage
In its simplest...