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():
Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready.
- Message based Communication in IPC (inter process communication)
- Chat application between two processes using signals and shared memory
- Inter-process Communication using a shared stack
- Inter Process Communication (IPC)
- Signals in C language
- Program error signals
- Difference between Process Image and Multi Thread Process image
- Create n-child process from same parent process using fork() in C
- Process Table and Process Control Block (PCB)
- Pass the value from child process to parent process
- Process states and Transitions in a UNIX Process
- Process Scheduler : Job and Process Status
- Methods in Interprocess Communication
- Interprocess Communication in Distributed Systems
- Difference between Program and Process
- Difference between Process and Kernel Thread
- Difference between Process and User Level Thread
- Difference between Thread Context Switch and Process Context Switch
- Difference between Process and Thread
- Getting System and Process Information Using C Programming and Shell in Linux
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.