当前位置:网站首页>Epoll horizontal departure, which edge triggers
Epoll horizontal departure, which edge triggers
2022-07-28 16:53:00 【be faithful to one 's husband unto death】
LT and ET Pattern
epoll Operations on file descriptors are 2 Patterns : LT and ET
LT Level Trigger, Level trigger Default Only unprocessed read / write events on the file description symbol will be notified , As long as there are events, they will continue to trigger , Until it's done
ET Edge Trigger, edge-triggered adopt EPOLLET To set up Notify when and only when a read-write event arrives , The same event is triggered only once, or only when two state transitions from non triggering to triggering are triggered
LT(level triggered) It's the default way of working , And at the same time Support block and no-block socket. In this way , The kernel tells you if a file descriptor is ready , Then you can be ready for this fd Conduct IO operation . If you don't do anything , The kernel will continue to inform you , therefore , This mode is less likely to make errors in programming . Conventional select/poll They are all representatives of this model . This model is equivalent to an efficient poll
To adopt LT File descriptor for mode operation , When epoll_wait When an event is detected on it and the application is notified of this event , The application does not have to deal with this event immediately . such , When the application next calls epoll_wait when , epoll_wait This event will also be notified to the application again , Until the event is handled .
ET (edge-triggered) It's a high-speed way of working , Only support no-block socket. In this mode , When the descriptor is never ready to be ready , The kernel passes through epoll Tell you . Then it assumes that you know the file descriptor is ready , And I won't describe it for that file Sign to send more ready notifications , Until you do something that makes that file descriptor no longer ready ( such as , You're sending , To receive or receive requests , Or when the transmitted and received data is less than a certain amount One. EWOULDBLOCK error ). But notice , If it's not right all the time fd do IO operation ( So it becomes not ready again ), The kernel will not send any more notifications (only once), But in the TCP Agreement ,ET The acceleration effect of the model still needs more benchmark confirm .
And when going epoll Register a file descriptor in the kernel event table EPOLLET When an event is , epoll Will be with ET Mode to operate the file descriptor , ET The pattern is epoll The efficient working mode of . To adopt ET File descriptor for mode operation , When epoll_wait When an event is detected on it and the application is notified of this event , The application must process the event immediately , Because of the following epoll_wait The call will no longer notify the application of this event .
so , ET The mode reduces the same in a large way epoll The number of times the event was triggered repeatedly , So it's more efficient than LT Mode high .
边栏推荐
- Kubeedge releases white paper on cloud native edge computing threat model and security protection technology
- Sort 2 bubble sort and quick sort (recursive and non recursive explanation)
- epoll水平出发何边沿触发
- Debugging methods of USB products (fx3, ccg3pa)
- Mysql与Oracle的13点区别
- 结构化设计的概要与原理--模块化
- Leetcode learn complex questions with random pointer linked lists (detailed explanation)
- First day of QT study
- IM即时通讯软件开发网络请求成功率的优化
- Call DLL file without source code
猜你喜欢

FX3开发板 及 原理图

Sort 1-insert sort and Hill sort

ABAQUS GUI interface solves the problem of Chinese garbled code (plug-in Chinese garbled code is also applicable)

Each account corresponds to all passwords, and then each password corresponds to all accounts. How to write the brute force cracking code

排序4-堆排序与海量TopK问题

Leetcode learn complex questions with random pointer linked lists (detailed explanation)

Text filtering skills

WSL+Valgrind+Clion

Tcp/ip related
![[pointer internal skill cultivation] character pointer + pointer array + array pointer + pointer parameter (I)](/img/e8/2044cae63fe2145ce6294cb1fdfaa0.png)
[pointer internal skill cultivation] character pointer + pointer array + array pointer + pointer parameter (I)
随机推荐
Ansa secondary development - build ansa/meta secondary development environment on pycharm
"Wei Lai Cup" 2022 Niuke summer multi school training camp 3 j.journey 0-1 shortest path
Efficiency comparison of three methods for obtaining timestamp
About mit6.828_ HW9_ Some problems of barriers xv6 homework9
Leetcode daily practice - the number of digits in the offer 56 array of the sword finger
CRC16 data verification supports modelbus and XMODEM verification modes (C language)
Li Hongyi, machine learning 5. Tips for neural network design
Some suggestions on optimizing HyperMesh script performance
快速掌握 Kotlin 集合函数
Kubeedge releases white paper on cloud native edge computing threat model and security protection technology
Sort 5-count sort
Li Hongyi, machine learning 4. Deep learning
FX3开发板 及 原理图
Sort 1-insert sort and Hill sort
Ansa secondary development - Introduction to interface development tools
【指针内功修炼】字符指针 + 指针数组 + 数组指针 + 指针参数(一)
[pointer internal skill cultivation] character pointer + pointer array + array pointer + pointer parameter (I)
信号屏蔽与处理
First day of QT study
【深度学习】:《PyTorch入门到项目实战》第九天:Dropout实现(含源码)