003 Linux System ProgrammingIssues, queries and suggestions related to Linux, Linux Programming, IPC, Interprocess Communication, Synchronization, Semaphore, System Programming, Linux Software Development.
Pipes are basis of INTERPROCESS COMMUNICATION, It is form of data transfer from one process to another. Pipes generally communicate in HALF DUPLEX MODE i.e at one time only one process can input in pipe. One process writes in pipe and other process reads from that pipe created. Default size of a pipe is 64k, It uses same concept of circular queue. Pipe function has the following prototype int pipe(int file_descripter[2]); It fills this array with two new file descripters and returns a zero on success else returns -1 indicating failure. WORKING: The writter will go on block on write on pipe full condition if reader is connected ie AUTOMATIC BLOCKING, Reader will go on block on read on pipe empty if the writter is connected, In these conditions we need a terminal handler. Pipe is always connected between parent and hijacked child for one way communication, Sometimes FIFO(named pipes) are used for connecting a process to unrelated process without creating child.