Inter - process communication between embedded Linux (v)--Introduction to interprocess communication
I. Introduction to inter-process communication
l inux process communication way linux of Bell Labs. system V IPC and BSD Socket two interprocess communication mechanisms
Linux inter-process communication methods include: Pipelines ,FIFO, signal , System v Message Queuing,System v semaphore,System v shared memory, Socket Communication.
Purpose of inter-process communication:
A, Data Transfer : inter-process needs to transfer data to each other
B, Shared data: multiple Inter -process operations sharing data
C, Notification Events : inter-process needs to notify the occurrence of an event
D, resource sharing: Sharing the same resources among multiple processes , requires the kernel to provide lock and sync mechanisms
E, Process Control: Some processes need to complete control over the execution of another process, such as Debug process)
Second,
advantages and disadvantages of multi-process programming
1. Advantages
A, each process is independent of each other, does not affect the stability of the main program, the child process crashes okay
B, by increasing the CPU , you can easily expand performance
C, can minimize line Cheng / unlocking effect, greatly improving performance
D, each child process has 4GB address space and related resources, the overall performance limit can be very large
2. Disadvantages
A, logic control complex, need to interact with main program
B, need to cross process boundaries, if there is a large amount of data transfer, it is not very good, suitable for small data transfer, dense operation
C, multi-process scheduling overhead is relatively large
This article from "Endless life, Struggle not only" blog, reprint please contact the author!
Inter-process communication between embedded Linux (v)--Introduction to interprocess communication