当前位置:网站首页>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内核读数据拿到缓冲区,直接发出去
边栏推荐
- [AI information monthly] 350 + resources! All the information and trends that can't be missed in June are here! < Download attached >
- 商汤进入解禁期:核心管理层自愿禁售 强化公司长期价值信心
- 田溯宁投的天润云上市:市值22亿港元 年利润下降75%
- 全局过滤器(处理时间格式)
- 2022年6月编程语言排行,第一名居然是它?!
- 微信小程序开发 – 用户授权登陆「建议收藏」
- BAIC bluevale: performance under pressure, extremely difficult period
- 印象深刻的bug汇总(持续更新)
- 开发说,“ 这个不用测,回归正常流程就行 “,测试人员怎么办?
- The idea runs with an error command line is too long Shorten command line for...
猜你喜欢
Intel Labs announces new progress in integrated photonics research
Oracle和JSON的结合
十年磨一剑:蚂蚁集团可观测性平台 AntMonitor 揭秘
Wonderful! MarkBERT
Technology sharing | introduction to linkis parameters
"Target detection" + "visual understanding" to realize the understanding and translation of the input image (with source code)
What are the advantages and disadvantages of PHP
Intel Labs annonce de nouveaux progrès en photonique intégrée
名创拟7月13日上市:最高发行价22.1港元 单季净利下降19%
Tempest HDMI leak reception 4
随机推荐
Graduation season · advanced technology er
Intel Labs announces new progress in integrated photonics research
Personal mall two open Xiaoyao B2C mall system source code - Commercial Version / group shopping discount seckill source code
Getting started with Paxos
证券账户随便哪里开都能使用吗 开户安全吗
Y48. Chapter III kubernetes from introduction to mastery -- pod status and probe (21)
小米手机解BL锁教程
商汤进入解禁期:核心管理层自愿禁售 强化公司长期价值信心
LeetCode. 515. Find the maximum value in each tree row___ BFS + DFS + BFS by layer
How does MySQL copy table data from one database to another (two databases are not linked to the same database)
Database experiment report (I)
Technology sharing | introduction to linkis parameters
2022年6月编程语言排行,第一名居然是它?!
Whether lending a bank card to others constitutes a crime
8 best practices to protect your IAC security!
華為設備配置大型網絡WLAN基本業務
银行卡借给别人是否构成犯罪
The first anniversary of the data security law, which four major changes are coming?
Cvpr22 | CMT: efficient combination of CNN and transformer (open source)
openinstall:微信小程序跳转H5配置业务域名教程