Pipes, Vfork

You might also like

Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 2

named pipe ( is commonly known as FIFO) can be used between 2 totally unrelated processes to communicate.

however pipes cannot be used by process that don't have some common ancestry (eg parent-child).

UNNAMED-They are created, used and destroyed within the life a set of processes.
Each end of the pipe has its own file descriptor. One end is for reading and one end is for writing. When you are done with a pipe, it is closed like any other file.

Named pipes
Named pipes are also called FIFOs (first in first out). They have names and exist as special files within a file system. (file type p) They exist until they are removed with rm or unlink() They can be used with unrelated process not just descendants of the pipe creator.
Pipe is unidirectional , but named pipe is bidirectional flow

Fork and vfork () diff


fork creates a child process and the parent process to run, and vfork created child process, the parent process, when blocked, and only until the child process to normal following the withdrawal of the parent before the process started 56. Difference between the fork() and vfork() system call? During the fork() system call the Kernel makes a copy of the parent processs address space and attaches it to the child process. But the vfork() system call do not makes any copy of the parents address space, so it is faster than the fork() system call. The child process as a result of the vfork() system call executes exec() system call. The child process from vfork() system call executes in the parents address space (this can

overwrite the parents data and stack ) which suspends the parent process until the child process exits.

vfork - parent is suspended until child exits or exec's. mainly memory and stack are shared to the child.

You might also like