top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

OS: Difference between pipe and fifo ?

+3 votes

What is the difference between Pipe and FIFO?

posted Nov 15, 2013 by Ganesh Kumar

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button
FIFO is named PIPE so basically you want to know difference between named and unnamed PIPE right?

1 Answer

+2 votes

1> Pipe uses the internal data structure for this (It already reserved few space for creating pipe) But FIFO is physically present in our directory.
2> Pipe can be accessed through file descriptor which he returned when using pipe system call,But FIFO having name so we can access and load it in to memory using its file name.
3> pipe can be accessed to the related process only(parent -child process) But fifo is accessed to unrelated process too.
4> While reading the pipe its writing end should be closed and reverse also bears the same but in case of fifo as many process can access the same file at a time.
5> Pipe is transient in nature it exists till the process is running but FIFO exists until u deleted it from file system.
6> As it is a file so any time we change the file properties.

answer Nov 15, 2013 by Sachidananda Sahu
Very nice description Sachi..., hope it is helpful for Ganesh.
for fifo also we can access by file descriptor only. But the main difference is PIPE is kernel persistent means once the related process closes no where exist. And coming to FIFO has filesystem persistence, it exists even after the processes exits also.
Yes Point 5 Covers it :-)