Interprocess Communication (IPC) Methods: UNIX Domain Sockets

UNIX domain socket (UNIX domain socket) provides us with a convenient way to establish communication channels between processes and has many useful built-in functions. Itsupports both stream-oriented (TCP) and datagram-oriented (UDP) protocols as TCP/IP internet sockets. We can also choose between blocking and non-blocking modes. First you need to create a socket and specify AF_UNIX […]

Linux – Interprocess Communication (System V)

Table of Contents 1. Shared memory Apply for shared memory shmget Control shared memory shmctl Associative shared memory shmat / Deassociated shared memory shmdt 2. Message queue Create or open a message queue msgget send message msgsnd / receive message msgrcv Control message msgctl 3. Semaphore Create or open a semaphore semget Semaphore operation semop […]

Linux – Interprocess Communication (Pipes)

Directory 1. Inter-process communication Second, the pipeline anonymous pipe named pipe One, inter-process communication InterProcess Communication (IPC, InterProcess Communication), that is, the dissemination or exchange of information between different processes; since the general process user address space is independent and cannot directly access the address space of other processes, information exchange between processes must pass […]

Several ways of interprocess communication (IPC)

Inter-process communication (IPC) 1. Common communication methods 2. Low-level IPC methods document 3. The IPC mechanism commonly used in this machine 3.1 Anonymous pipe 3.2 Named pipe FIFO 3.3 Message Queue MessageQueue 3.4 shared memory SharedMemory 3.5 Semaphore Semaphore 3.6 Signal Signal 3.7 unix domain socket 4. IPC mechanism on different computers 5. The number […]

A simple example of Android Kotlin using Binder, pipes, sockets, file sharing and semaphores for interprocess communication

In most cases, what we come into contact with are some conceptual articles. I hope this article can bring you a different experience, so that you can better digest the knowledge related to inter-process communication. tips: In actual development, if inter-process communication is required, it is recommended to use Binder, Broadcast, ContentProvider, etc. These mechanisms […]

Processes, Threads, and Interprocess Communication – Signal Catching

Signal capture Signal capture process: Define the execution function handle of the new signal. Use the signal/sigaction function to associate the custom handle with the specified signal. signal function: typedef void (*sighandler_t)(int); sighandler_t signal(int signum, sighandler_t handler); Function: capture signal to execute custom function Return value: returns the original signal processing function on success, returns […]

Process, thread and interprocess communication – thread pool concept and implementation

Thread pool concept and implementation Concept: In layman’s terms, it is a pool of threads, a set of threads that can complete tasks in a loop necessity: We usually create a thread, complete a certain task, and wait for the thread to exit. But when a large number of threads need to be created, suppose […]

Processes, Threads, and Interprocess Communication – Memory Mapping

Memory Mapping Concept Shared memory can map ordinary files through mmap(), so that a disk file is mapped to a buffer in the memory, and the process can access the file like ordinary memory, without calling read and write. Advantages of mmap Realized efficient interaction between user space and kernel space Function definition: void *mmap(void […]