Process communication refers to the exchange of information between processes.
Low-level communication method: PV operation
Advanced communication methods: 1. Shared storage 2. Message passing 3. Pipeline communication
shared storage
Low-level data structures are shared, and high-level storage areas are shared.
When reading and writing shared space, you need to use mutual exclusion tools.
messaging
Data is exchanged using two primitives: sending messages and receiving messages .
In microkernel operating systems, this method is used between the microkernel and the server.
1. Direct communication method: Send the message directly to the receiving process.
2. Indirect communication method: sending the message to an intermediate entity (widely used in computer networks)
pipe communication
Half-duplex, the pipe is a .pipe file.
Data is first in first out in the pipeline , which is also the main difference between shared memory and pipelines
The pipeline mechanism must have the ability to mutually exclude, synchronize, and determine the existence of the other party.
Pipe reading is a one-time operation, and once the data is read, the space is released so that more data can be obtained.
A pipe allows multiple writing processes and one reading process.