当前位置:网站首页>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 .
边栏推荐
- 正大留4的主账户信息汇总
- 06 decorator mode
- Pytest learning ----- pytest assertion of interface automation testing
- C language practice - number guessing game
- List of common bugs in software testing
- My first experience of shadowless cloud computer
- 缓存一致性解决方案——改数据时如何保证缓存和数据库中数据的一致性
- GeoTrust ov multi domain SSL certificate is 2100 yuan a year. How many domain names does it contain?
- Idea autoguide package and autodelete package Settings
- Pytest learning ----- pytest Interface Association framework encapsulation of interface automation testing
猜你喜欢

Record the bug of unity 2020.3.31f1 once

Why can't you remember when reading? Why can't you remember- My technology learning methodology

Federal learning: dividing non IID samples according to Dirichlet distribution

Steam教育的实际问题解决能力

C language practice - binary search (half search)
![Introduction to Luogu 3 [circular structure] problem list solution](/img/fd/c0c5687c7e6e74bd5c911b27c3e19c.png)
Introduction to Luogu 3 [circular structure] problem list solution

MySQL table insert Chinese change? Solution to the problem of No

C language practice - number guessing game

June book news | 9 new books are listed, with a strong lineup and eyes closed!

解决:代理抛出异常错误
随机推荐
Knowledge arrangement about steam Education
6月书讯 | 9本新书上市,阵容强大,闭眼入!
Ruby replaces gem Alibaba image
idea自動導包和自動删包設置
Binary tree problem solving (1)
win10 磁盘管理 压缩卷 无法启动问题
Lay the foundation for children's programming to become a basic discipline
Ognl和EL表达式以及内存马的安全研究
DJB Hash
Mysql表insert中文变?号的问题解决办法
Analyze the space occupied by the table according to segments, clusters and pages
面试会问的 Promise.all()
Read "the way to clean code" - function names should express their behavior
Leetcode merge sort linked list
js面试收藏试题1
Precipitate yourself and stay up late to sort out 100 knowledge points of interface testing professional literacy
Let正版短信测压开源源码
【毕业季·进击的技术er】年少有梦,何惧彷徨
解决:代理抛出异常错误
Future trend of automated testing ----- self healing technology