Inter Process Communications – Pipes Explained With Simple Example

Pipes are one of the oldest and simplest form of Inter-Process communications. Typically, a pipe is half-duplex way of transmitting data between two processes which means data can be passed in one direction only. It can be used only between processes having common parent.
Normally pipes are used between parent and child processes.

(more…)
Inter Process Communications – Pipes Explained With Simple Example Read More

fork () Function Explained With Simple Example

Fork () is a system call in unix which can be used by a process to create a new process. This is a special function which is called once but it returns twice, one for parent process who called the fork () and second for the child process which is created by fork (). Fork () returns process id of the new process in parent process whereas it returns 0 for child process.

Syntax of fork () function call is as follows:

#include <unistd.h>
pid_t fork(void);   /* Returns: 0 in child, process ID of child in parent, −1 on error */
(more…)
fork () Function Explained With Simple Example Read More