[Operating system] Process communication IPC

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.

 

f54532f1da694704a7e997816817dbcf.png

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)

cf454681f3f64bb5a5cd2c2c3a155fe4.png

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.

 

Guess you like

Origin blog.csdn.net/l203018/article/details/132891027