FIFOs in a Network Environment



next up previous contents
Next: Append Mode write() Up: Specific Environment Issues Previous: Attribute Manipulation

FIFOs in a Network Environment

 

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:

  1. Bytes written to a FIFO are always written as though they were written in append mode.
  2. Bytes read from a FIFO are always read from the beginning of the file and then removed.
  3. When all processes which have the FIFO open close the FIFO, any bytes remaining in the FIFO are removed.
  4. Writing to a FIFO which no process has open for reading results in an error condition (see sec. 2.1).

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:



next up previous contents
Next: Append Mode write() Up: Specific Environment Issues Previous: Attribute Manipulation



Karen Olsen
Mon Aug 21 10:18:32 EDT 1995