Pipes are synchronized way of passing information between processes.
Differences:
Unnamed
Pipe(PIPE)
|
Named Pipe(FIFO)
|
They are unidirectional.
|
They can be bidirectional.
|
They can only be used by related processes (parent/child or
child/child having the same parent.)
|
They can be used by any process (unrelated processes.)
|
They are opened at the time of creation only.
|
They are not open at the time of creation.
|
They exist as long as the file descriptors are open.
|
They exist as directory entries
|
They are created by using the function pipe().
|
They are created by using the function mkfifo().
|
Eg: int pipe(int fd[2])
fd[0] – descriptor used for reading
fd[1] – descriptor used for writing
|
Eg: int mkfifo(char *path, mode_t mode)
|
No comments:
Post a Comment