当前位置:网站首页>epoll介绍
epoll介绍
2022-07-01 11:19:00 【每日一悟】
多个客户端连接到达kernel(内核)
线程/进程 read fd 读内核
BIO:socket在 这个时期是blocking (多进程)
NIO:同步非阻塞时期 (但进程)
多路复用NIO:kernel中增加了select
NIO:如果有1000fd代表用户进程轮训调用1000次kernel,成本大
多路复用NIO:kernel中增加了select ,内核先select(1000fds),返回有用的,进程再read(fd)
用户态、内核态
内核的区域,用户是不能访问的,所以需要传递数据,导致fd相关数据拷来拷去
如何改善:共享空间(红黑树、链表、mmap)属于内核的部分,也属于用户的部分
进程中文件描述符放红黑树,将数据放到链表里
零拷贝:kernel中多了个sendfile(系统调用)(out,in) 、read(fd)、write(fd)
网卡到kernel socketIO
文件到kernel 文件IO
sendfile:进程调sendfile内核读数据拿到缓冲区,直接发出去
边栏推荐
- ES6 Promise用法小结
- Getting started with Paxos
- Website source code whole site download website template source code download
- How to realize the four isolation levels of MySQL (brief)
- Nordic nrf52832 flash 下载M4错误
- Goldfish rhca memoirs: do447 uses ansible to communicate with API -- using ansible tower API to start jobs
- Can servers bundled with flask be safely used in production- Is the server bundled with Flask safe to use in production?
- CVPR 2022 | Virtual Correspondence: Humans as a Cue for Extreme-View Geometry
- China's cellular Internet of things users have reached 1.59 billion, and are expected to surpass mobile phone users within this year
- Tempest HDMI leak reception 4
猜你喜欢

Google's new paper Minerva: solving quantitative reasoning problems with language models

Mall applet source code open source version - two open

Spam filtering challenges

Mingchuang plans to be listed on July 13: the highest issue price is HK $22.1, and the net profit in a single quarter decreases by 19%

软件项目管理 9.2.软件项目配置管理过程

Wonderful! MarkBERT

Tempest HDMI leak reception 4

英特尔实验室公布集成光子学研究新进展

Huawei equipment is configured with large network WLAN basic services

关于Keil编译程序出现“File has been changed outside the editor,reload?”的解决方法
随机推荐
Mysql的四个隔离级别是如何实现的 (简要)
The project bar on the left side of CodeBlocks disappears, workspace automatically saves the project, default workspace, open the last workspace, workspace (Graphic tutorial, solved)
Tempest HDMI leak receive 5
What are the advantages and disadvantages of PHP
TEMPEST HDMI泄漏接收 5
CVPR 2022 | Virtual Correspondence: Humans as a Cue for Extreme-View Geometry
CVPR 2022 | self enhanced unpaired image defogging based on density and depth decomposition
The developer said, "this doesn't need to be tested, just return to the normal process". What about the testers?
Exposure:A White-Box Photo Post-Processing Framework阅读札记
"Target detection" + "visual understanding" to realize the understanding and translation of the input image (with source code)
力扣(LeetCode)181. 超过经理收入的员工(2022.06.29)
Website source code whole site download website template source code download
Neurips 2022 | cell image segmentation competition officially launched!
我国蜂窝物联网用户已达 15.9 亿,年内有望超越移动电话用户
JS日期格式化转换方法
Google's new paper Minerva: solving quantitative reasoning problems with language models
Continuous delivery -pipeline getting started
提问:测试工程师应该具备哪些职业素养?
Flip the array gracefully
Can I open a securities account anywhere? Is it safe to open an account