Post

Inter Process Communication

βœ… Inter Process Communication

communication among processes
πŸ’‘ process have independent memory, is run independently
use semaphore, mutext(only one process for shared data)

βœ… Types of Inter Process Communication

  • pipe
  • socket
  • file

1. Anonymous PIPE

  • one way communication
  • PIPE can conenct two processes
  • one process: only write, other process: only read
  • used for when you know the other communicating process(like parent and child process communication)
  • πŸ‘πŸ» simple to use
  • πŸ‘ŽπŸ» if both ways communication is needed, two PIPEs are required

2. Named PIPE

  • when you don’t know the other process to communicate
    > one way communication

3. Message Queue

  • Queue: unlike pipe, is memory
  • several process can use numbered data

4. Shared Memory

  • share data among processes
  • πŸ’‘ process have independent memory, other process cannot access
  • Shared Memory lets process ot share memory space
  • πŸ‘πŸ» fastest in IPC

5. Memory Map

  • like Shared Memory, but shares by mapping open file to memory
  • share file+memory
  • πŸ‘πŸ» for large files

6. Socket

  • network socket communication
  • client-server communication through socket
  • server: bind, listen, accecpt/ client: connect
This post is licensed under CC BY 4.0 by the author.