当前位置:网站首页>MMAP zero copy knowledge point notes
MMAP zero copy knowledge point notes
2022-07-02 04:50:00 【Chirp cat】
In the traditional way IO Send local files to the network
Co occurring 4 Second copy ,4 Context switching between subkernel state and user state .
call read() Method , The program sinks from user mode to kernel mode .
Copy the files in the disk to the kernel buffer (DMA copy).
Copy the data in the kernel buffer to the user buffer (CPU copy), The program changes from kernel mode to user mode ,read() Method returns .
call write() Method , The program sinks from user mode to kernel mode again , And copy the data in the user buffer to socket buffer (CPU copy).
take socket The data in the buffer is copied to the network card and sent (DMA copy), The program changes from kernel mode to user mode ,write() Method returns .
DMA: Direct memory access ( For sharing CPU The pressure of copying )
With mmap Send local files to the network
Co occurring 3 Second copy ,4 Context switching between subkernel state and user state .
call mmap() Method , The program sinks from user mode to kernel mode .
Copy the files in the disk to the kernel buffer (DMA copy).
The program changes from kernel mode to user mode ,mmap() Method returns . At the same time, the kernel buffer and user mode buffer establish a mapping relationship , Kernel buffer and user buffer realize memory sharing .
call write() Method , The program sinks from user mode to kernel mode again . And copy the data in the kernel buffer directly to socket buffer (CPU copy).
take socket The data in the buffer is copied to the network card and sent (DMA copy), The program changes from kernel mode to user mode ,write() Method returns .
边栏推荐
- How muddy is the water in the medical beauty industry with a market scale of 100 billion?
- Oracle stored procedure and job task setting
- Common locks in MySQL
- There is no prompt for SQL in idea XML, and the dialect setting is useless.
- Application d'un robot intelligent dans le domaine de l'agroécologie
- 解决:代理抛出异常错误
- Typescript function details
- cs架构下抓包的几种方法
- Thinkphp Kernel wo system source Commercial Open source multi - user + multi - Customer Service + SMS + email notification
- 正大留4的主账户信息汇总
猜你喜欢

Practical problem solving ability of steam Education

Virtual machine installation deepin system

DC-1靶场搭建及渗透实战详细过程(DC靶场系列)

Markdown编辑语法

Thinkphp內核工單系統源碼商業開源版 多用戶+多客服+短信+郵件通知

Analyze the space occupied by the table according to segments, clusters and pages

面试会问的 Promise.all()

Unity particle Foundation

Thinkphp Kernel wo system source Commercial Open source multi - user + multi - Customer Service + SMS + email notification

idea自動導包和自動删包設置
随机推荐
记录一次Unity 2020.3.31f1的bug
How to write a client-side technical solution
How do I interview for a successful software testing position? If you want to get a high salary, you must see the offer
Realize the function of data uploading
10 minute quick start UI automation ----- puppeter
Federal learning: dividing non IID samples according to Dirichlet distribution
Let正版短信测压开源源码
面试会问的 Promise.all()
C language practice - number guessing game
Deeply understand the concepts of synchronization and asynchrony, blocking and non blocking, parallel and serial
Unity particle Foundation
Typescript function details
TypeScript类的使用
二叉树解题(二)
June book news | 9 new books are listed, with a strong lineup and eyes closed!
06 decorator mode
解决:代理抛出异常错误
idea自動導包和自動删包設置
Application d'un robot intelligent dans le domaine de l'agroécologie
Beginner crawler - biqu Pavilion crawler