Named pipe FIFO
In this section, we shall see what are FIFOs and how they work
Last updated
In this section, we shall see what are FIFOs and how they work
Last updated
A FIFO special file (a named pipe with no extension) is similar to a pipe, except that it is accessed as part of the filesystem. It can be opened by multiple processes for reading or writing. When processes are exchanging data via the FIFO, the kernel passes all data internally without writing it to the filesystem.
Note: Opening the read or write end of a FIFO blocks until the other end is also opened (by another process or thread).
There are 2 ways of making a FIFO file:
Using the command mkfifo in the terminal itself
Creating a FIFO in the program itself
Example:
The process stops there until we have another process reading from the FIFO
So we run this command in the same directory as the FIFO