当前位置:网站首页>传统的IO存在什么问题?为什么引入零拷贝的?
传统的IO存在什么问题?为什么引入零拷贝的?
2022-06-24 19:08:00 【InfoQ】
传统的IO存在什么问题?为什么引入零拷贝的?
read(file, tmp_buf, len);
write(socket, tmp_buf, len);

- 第一次拷贝,把磁盘上的数据拷贝到操作系统内核的缓冲区里,这个拷贝的过程是通过 DMA 搬运的。
- 第二次拷贝,把内核缓冲区的数据拷贝到用户的缓冲区里,于是我们应用程序就可以使用这部分数据了,这个拷贝到过程是由 CPU 完成的。
- 第三次拷贝,把刚才拷贝到用户的缓冲区里的数据,再拷贝到内核的 socket 的缓冲区里,这个过程依然还是由 CPU 搬运的。
- 第四次拷贝,把内核的 socket 缓冲区里的数据,拷贝到网卡的缓冲区里,这个过程又是由 DMA 搬运的。
边栏推荐
- 对“宁王”边卖边买,高瓴资本“高抛低吸”已套现数十亿
- 用手机摄像头就能捕捉指纹?!准确度堪比签字画押,专家:你们在加剧歧视
- Docker installing Oracle
- gateway
- Some ideas about chaos Engineering
- C langage pour le déminage (version simplifiée)
- 1、 Downloading and installing appium
- 情绪识别AI竟「心怀鬼胎」,微软决定封杀它!
- The Network Security Review Office launched a network security review on HowNet, saying that it "has a large amount of important data and sensitive information"
- 用自身细胞作为原料,首例3D打印耳朵移植成功!未来可打印更复杂器官
猜你喜欢

建立自己的网站(14)
![[video tutorial] functions that need to be turned off in win10 system. How to turn off the privacy option in win10 computer](/img/14/0313857adc178ecee4c866a05e54aa.jpg)
[video tutorial] functions that need to be turned off in win10 system. How to turn off the privacy option in win10 computer

顺序栈1.0版本

大一女生废话编程爆火!懂不懂编程的看完都拴Q了

2022年最新四川建筑八大员(电气施工员)模拟题库及答案

16 excellent business process management tools

Material management system based on SSM (source code + document + database)

云计算发展的 4 个阶段,终于有人讲明白了

Implement the redis simple client customized based on socket

Dongyuhui is not enough to bring goods to "rescue" live broadcast
随机推荐
Making startup U disk -- Chinese cabbage U disk startup disk making tool V5.1
Internet of things? Come and see Arduino on the cloud
Coinbase将推出首个针对个人投资者的加密衍生产品
Material management system based on SSM (source code + document + database)
gateway
What is showcase? What should showcase pay attention to?
用手机摄像头就能捕捉指纹?!准确度堪比签字画押,专家:你们在加剧歧视
顺序栈1.0版本
Oracle create tablespaces and tables
实现基于Socket自定义的redis简单客户端
Cooking business experience of young people: bloggers are busy selling classes and bringing goods, and the organization earns millions a month
Apache+PHP+MySQL环境搭建超详细!!!
Teach you how to view the number of connected people on WiFi in detail how to view the number of connected people on WiFi
Predicate
Dongyuhui is not enough to bring goods to "rescue" live broadcast
视频平台如何将旧数据库导入到新数据库?
Stop using system Currenttimemillis() takes too long to count. It's too low. Stopwatch is easy to use!
Two fellow countrymen from Hunan have jointly launched a 10 billion yuan IPO
等等党们的胜利!挖矿退潮后,显卡价格全面暴跌
DX12引擎开发课程进度-这个课程到底讲到哪里了