当前位置:网站首页>MMAP学习
MMAP学习
2022-07-05 21:34:00 【51CTO】
MMAP
虚拟进程地址空间(vm_area_struct)和虚拟内核地址空间(vm_struct)都映射到同一块物理内存空间。当Client端与Server端发送数据时,Client(作为数据发送端)先从自己的进程空间把IPC通信数据copy_from_user拷贝到内核空间,而Server端(作为数据接收端)与内核共享数据,不再需要拷贝数据,而是通过内存地址空间的偏移量,即可获悉内存地址,整个过程只发生一次内存拷贝。一般地做法,需要Client端进程空间拷贝到内核空间,再由内核空间拷贝到Server进程空间,会发生两次拷贝。
对于进程和内核虚拟地址映射到同一个物理内存的操作是发生在数据接收端,而数据发送端还是需要将用户态的数据复制到内核态。到此,为何不直接让发送端和接收端直接映射到同一个物理空间,那样就连一次复制的操作都不需要了,0次复制操作那就与Linux标准内核的共享内存的IPC机制没有区别了,对于共享内存虽然效率高,但是对于多进程的同步问题比较复杂,而管道/消息队列等IPC需要复制2两次,效率较低。
如下是大致流程图:
边栏推荐
- leetcode:1755. Sum of subsequences closest to the target value
- vant 源码解析之 utils/index.ts 工具函数
- Utils/index TS tool function
- Access Zadig self-test environment outside the cluster based on ingress controller (best practice)
- Zhang Lijun: la pénétration de l’incertitude dépend de quatre « invariants»
- Postgres establish connection and delete records
- Sorting out the problems encountered in MySQL built by pycharm connecting virtual machines
- Selenium finds the contents of B or P Tags
- 冯唐“春风十里不如你”数字藏品,7月8日登录希壤!
- Establishment of terminal security capability verification environment and penetration test records
猜你喜欢
EN 438-7 laminated sheet products for building covering decoration - CE certification
2.2.3 output of documents
Golang(1)|从环境准备到快速上手
2022-07-03-cka- latest feedback from fans
Access Zadig self-test environment outside the cluster based on ingress controller (best practice)
Uni app Bluetooth communication
Opérations de lecture et d'écriture pour easyexcel
MySQL 千万数据量深分页优化, 拒绝线上故障!
Li Kou ----- the maximum profit of operating Ferris wheel
基于vertx-web-sstore-redis的改造实现vertx http应用的分布式session
随机推荐
Dictionary tree simple introductory question (actually blue question?)
@Validated基础参数校验、分组参数验证和嵌套参数验证
张丽俊:穿透不确定性要靠四个“不变”
Problems encountered in office--
Aitm2-0002 12s or 60s vertical combustion test
2.2.5 basic sentences of R language drawing
递归查询多级菜单数据
postgis 安装地理信息扩展
Evolution of zhenai microservice underlying framework from open source component encapsulation to self-development
100 cases of shell programming
vant 源码解析 event.ts 事件处理 全局函数 addEventListener详解
Reading and writing operations of easyexcel
Influence of oscilloscope probe on signal source impedance
Longest swing sequence [greedy practice]
Environment configuration problem record
postgres 建立连接并删除记录
Emotional analysis of wechat chat records on Valentine's day based on Text Mining
Interviewer: will concurrent programming practice meet? (detailed explanation of thread control operation)
Deployment of Jenkins under win7
Some things make feelings nowhere to put