Prerequisite : C signal handling
In this post, the communication between child and parent processes is done using kill() and signal(), fork() system call.
- fork() creates the child process from the parent. The pid can be checked to decide whether it is the child (if pid == 0) or the parent (pid = child process id).
- The parent can then send messages to child using the pid and kill().
- The child picks up these signals with signal() and calls appropriate functions.
Example of how 2 processes can talk to each other using kill() and signal():
GeeksforGeeks has prepared a complete interview preparation course with premium videos, theory, practice problems, TA support and many more features. Please refer Placement 100 for details
- Message based Communication in IPC (inter process communication)
- Inter Process Communication (IPC)
- Inter-process Communication using a shared stack
- Signals in C language
- Program error signals
- Chat application between two processes using signals and shared memory
- Create n-child process from same parent process using fork() in C
- Process Table and Process Control Block (PCB)
- Process states and Transitions in a UNIX Process
- Pass the value from child process to parent process
- Methods in Interprocess Communication
- Interprocess Communication in Distributed Systems
- Process Scheduler : Job and Process Status
- Process Synchronization | Set 2
- Progress of a process