|
Diamond's model of parallel processing is based on the idea of communicating sequential processes (CSP), as described by C. A. R. Hoare. In this model, a computing system is a collection of concurrently active sequential processes that can communicate with each other only over channels.
|
| • | A channel can transfer messages from one process to exactly one other process. |
|
|
| • | A channel can carry messages in one direction only; if communication in both directions between two processes is required, two channels must be used. |
|
|
| • | Both the sender and receiver must agree on the size of message being transmitted. |
|
|
| • | Channels are blocking: a sending or receiving thread waits until the thread at the other end of the channel attempts to communicate. |
The first reaction of many readers used to queuing models of communication is to think something is missing. However, the blocking nature of channels is actually an important simplification that allows Diamond to implement them in varied and extremely efficient ways. The effect of non-blocking communication is achieved by making the application multi-threaded.
|
Each process can have any number of input and output channels. For example, a disk copy command built into a computer's operating system could be described as three concurrently executing processes: two floppy disk controller processes and one process doing the copying.

This example shows an important property of channel communications: they are synchronized. A process wanting to send a message over a channel is always forced to wait until the receiving process reads the message; this is known as blocking communication. In our example, this means that even if at some time the output floppy disk can't keep up with the input, the system still works properly. This is because the copy process is automatically forced to wait if it tries to send a message before the output disk process is ready to receive it.
Sometimes it is useful to allow a sending process to run ahead of a receiving one; in such cases you must add an explicit buffering process to the system.
Note that because a process in this model is connected to the outside world by its channels alone, the actual implementation of any individual process is not important. A process could be a bit of hardware, a software module, or an FPGA block; in particular it may also be another complex system, itself consisting of a number of communicating processes.
|