A FIFO is a special file whose semantics differ significantly from those of a regular file. FIFO means first-in-first-out. The semantics of a FIFO can be summarized in terms of the operations on a regular file as follows:
Some file systems do not have the concept of a FIFO. In a network environment, a FIFO could be located on a server. Consequently, processes using such a FIFO could be located on different clients. Some file systems do no support the capability of processes on different clients sharing the use of a FIFO located on a server, i.e., the FIFO is interpreted as a local object. For such a file system, only processes on the same client may share the use of the remote FIFO even though it is located on a server. An application should be able to determine whether FIFOs are supported and whether a FIFO is interpreted as a local or as a remote object.
Demonstrations were developed using an NFS implementation to illustrate the behavior of a FIFO when it is located on a server and it is accessed by processes on the same client and processes on different clients. Figure 4.1 illustrates how the demonstration proceeds. Process A reads from the FIFO and Process B writes to the FIFO. Commands are displayed in italics and the output of those commands is displayed in bold. The FIFO testfifo is created on a remote file system mounted at the directory mnt.
Figure 4.1: FIFO demonstration for processes on the same client.
Table 4.1: Summary of last-close semantic behavior using a FIFO located on an NFS server
Table 4.1 summarizes the results of using a FIFO on two different client/server configurations as follows:
Process A and Process B are both on Client A.
Process A creates a FIFO on the server and issues a command to
read from the FIFO.
Process B writes to the FIFO.
After Process B issues a ^D, both processes terminate
successfully.
Process A is on Client A and Process B is on Client B. Process A creates a FIFO on the server and issues a command to read from the FIFO. Process B writes to the FIFO. Process A is unable to read from the FIFO. Neither process is able to terminate successfully.