当前位置:网站首页>9. Process communication
9. Process communication
2022-07-20 17:14:00 【Friend a ㅤ】
Process of communication : Information exchange between processes .
- The memory address spaces owned by processes are independent of each other
- To ensure safety , One process cannot directly access the address space of another process
One 、 Shared memory
reason :
Two processes cannot directly access each other's address space
Handle :
The operating system will allocate a shared space for the two processes , The communication between the two processes will be completed through the shared space .
Be careful :
- The two processes' access to the shared space must be mutually exclusive
- Mutually exclusive access is realized through the tools provided by the operating system
- The operating system is only responsible for providing shared space and synchronization and mutual exclusion tools ( Such as P、V operation )
classification :
- Sharing based on data structure :
- Only fixed structures can be stored , If the length is 10 Array of
- This sharing method is slow 、 More restrictions , Is a low-level means of communication
- Store based sharing
- Draw a shared memory area in memory , The form of data 、 The storage location is controlled by the process , Not the operating system .
- Faster sharing , It is an advanced means of communication
Two 、 Pipeline communication
“ The Conduit ” It refers to a shared file used to connect the read-write process , also called pipe file .
The essence :
Open a fixed size buffer in memory .
Be careful :
- Pipes can only be used Half duplex communication , Only one-way transmission can be realized in a certain period of time . If you want to realize two-way simultaneous communication , You need to set up two pipes .
- Each process should Mutually exclusive To access the pipeline .
- Data is written to the pipeline as a character stream , When Pipeline full when , Write progress Of write() The system call will be Blocking , Wait for the reading and writing process to take away the data . When the reading process takes all the data , The pipe becomes empty , here Reading process Of read() The system call will be Blocking .
- If it's not full , You are not allowed to read . If you don't have time to read , You are not allowed to write .
- Once the data in the pipeline is read out , Just abandoned from the pipeline , That means There can be at most one read process , Otherwise, wrong data may be read .
3、 ... and 、 The messaging
Data exchange between processes to Formatted message In units of . Process communication passed OS Provided “ Send a message / receive messages ” Two The original language Data exchange .
边栏推荐
- Deep open intent classification with adaptive decision boundary AAAI2021开放集识别论文解读
- IDEA的Import changes 和enable auto-import
- Ordinary people who participate in we media: how do they earn from 30 to 30000 a month
- OpenSMax: Unknown Domain Generation Algorithm Detection ECAI2020开放集识别论文解读
- Generalized odin: Detecting out-of-distribution image without learning from out-of-distribution data
- Banyan loan atlas mainly has the following core components, which are customized through rest API
- 双亲委派模型和破坏性双亲委派模型详解
- Deep cnn-based multi-task learning for open-set recognition解读
- Is count (1) more efficient than count (*)?
- Google Chrome cannot be installed successfully after uninstallation
猜你喜欢
Interactive drawing of complex tables from the perspective of app
振动信号的采集与预处理
二进制、八进制、十进制、十六进制之间的转换
Explain output analysis of MySQL
OPEN-SET RECOGNITION WITH GRADIENT-BASED REPRESENTATIONS基于梯度表征的开放集识别
OOM内存溢出实战不得不看的经典
mongodb数据库
Cannot open a new task for virtual computer * * *
12. 进程调度的时机、切换与过程、方式
Openstack build enterprise private cloud - environment preparation
随机推荐
List集合排序(适用基本类型与对象类型)
FRP realizes intranet penetration and exposes intranet services through public server
Analyze QPS, TPS and other basic concepts from the perspective of multithreading
Google Chrome cannot be installed successfully after uninstallation
OpenGL ES之实现实时音频的可视化
[freeswitch development practice] over session limit 1000/locked, waiting on external entities
How does redis analyze slow query operations?
力扣——1046. 最后一块石头的重量
@RequestParam,@PathParam,@PathVariable等注解区别(部分注解的使用)
uni-app
Leetcode57-插入区间详解
# 搭建用户行为分析系统(一)——概述
Niuke multi school 1 C grab the seat!
10. 线程
C# 9.0 正式版所有新特性概述
Comparison of RDB and AOF persistence methods in redis
Redis 如何分析慢查询操作?
mysql. User table permission field description full introduction
Detailed instructions of nitric oxide (no) content detection kit abbkine
220622_preview,知识点10:DWS层搭建--销售主题宽表--step1--字段抽取