FIFO Inter-process communication in Linux User space

FIFO is similar to a pipe in the, but a FIFO has a name within the file system and hence can be opened like a normal file. This allows two un-related processes to communicate with each other using a FIFO. Since a FIFO has a name in the Linux name space, FIFO is also termed as a named pipe.

FIFO is normally used for uni-directional transmission as well. However, It is possible to create a FIFO with O_RDWR flag which allows both ends (client/server) to read/write on the FIFO. However, this is not the original intended use.

In the case of a uni-directional transmission using FIFO between two processes, the open call will block till both ends are ready for use.

A sample FIFO client/server example is depicted pictorially below:

FIG Courtesy: Linux Programming Interface

The API to create a FIFO is shown below

FIG Courtesy: Linux Programming Interface

The interested reader is guided to the Linux Programming Interface for a sample application.

POSIX Threads in Linux

Comments

  1. Pingback: Inter-process communication using Pipes in Linux User Space | Hitch Hiker's Guide to Learning

Leave a Reply

Your email address will not be published. Required fields are marked *