当前位置:网站首页>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内核读数据拿到缓冲区,直接发出去
边栏推荐
猜你喜欢

十年磨一剑:蚂蚁集团可观测性平台 AntMonitor 揭秘

全局过滤器(处理时间格式)

Tempest HDMI leak reception 4

Yoda unified data application -- Exploration and practice of fusion computing in ant risk scenarios

華為設備配置大型網絡WLAN基本業務

编译调试Net6源码

【AI资讯月刊】350+资源大盘点!6月不容错过的资料和动态,都都都在这里啦!<附下载>

田溯宁投的天润云上市:市值22亿港元 年利润下降75%

Dameng data rushes to the scientific innovation board: it plans to raise 2.4 billion yuan. Feng Yucai was once a professor of Huake

软件项目管理 9.2.软件项目配置管理过程
随机推荐
The idea runs with an error command line is too long Shorten command line for...
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)
MySQL in and not in() empty list error
TEMPEST HDMI泄漏接收 4
超详细黑苹果安装图文教程送EFI配置合集及系统
Oneconnect plans to be listed in Hong Kong on July 4: a loss of nearly 3 billion in two years, with a market capitalization evaporation of more than 90%
8 best practices to protect your IAC security!
Nordic nrf52832 flash download M4 error
优雅地翻转数组
Ultra detailed black apple installation graphic tutorial sent to EFI configuration collection and system
Mysql的四个隔离级别是如何实现的 (简要)
Continuous delivery -pipeline getting started
VScode快捷键(最全)[通俗易懂]
Activity workflow engine
商汤进入解禁期:核心管理层自愿禁售 强化公司长期价值信心
Compliance management of fund managers
CVPR22 |CMT:CNN和Transformer的高效结合(开源)
Goldfish rhca memoirs: do447 uses ansible to communicate with API -- using ansible tower API to start jobs
2022年6月编程语言排行,第一名居然是它?!
京东与腾讯续签合作:向腾讯发行A类股 价值最高达2.2亿美元