Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Examples of inter process communication(IPC)

I am wondering about actual examples or instances of inter process communication (IPC) which we encounter on a daily basis (which happen under the hood or otherwise) while using our laptop/desktop. I have always read about these theoretically from a textbook.

For example:

  • Between a parent process and child processes: one example of this in Linux I know is when a shell starts other processes and we can kill those processes using their process IDs.

  • Between two unrelated (in hierarchy) but cooperating processes?

like image 765
xyz Avatar asked May 14 '11 17:05

xyz


People also ask

What is Inter-process communication example?

The inter-process communication examples include the following. Posix uses the shared memory technique. Windows XP uses message passing technique. Mach uses the message passing technique.

What is the application of inter-process communication?

Interprocess communication allows one application to manage another and enables glitch-free data sharing. Interprocess communication helps send messages efficiently between processes.

What are the two types of interprocess communication?

There are two primary models of interprocess communication: shared memory and. message passing.


2 Answers

One way of doing IPC on the two cases you mentioned is using sockets.

I recommend taking a look at Beej's Guide to Unix Interprocess Communication for information and examples.

like image 59
karlphillip Avatar answered Sep 28 '22 15:09

karlphillip


Some examples of IPC we encounter on a daily basis:

  • X applications communicate with the X server through network protocols.
  • Pipes are a form of IPC: grep foo file | sort
  • Servers like Apache spawn child processes to handle requests.
  • many more I can't think of right now

And I am not even mentioning examples of IPC where the processes are on different computers.

like image 35
Kim Stebel Avatar answered Sep 28 '22 17:09

Kim Stebel