当前位置:网站首页>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 .
边栏推荐
- Call DLL file without source code
- About mit6.828_ HW9_ Some problems of barriers xv6 homework9
- Sort 3-select sort and merge sort (recursive implementation + non recursive implementation)
- CRC16 data verification supports modelbus and XMODEM verification modes (C language)
- IM即时通讯开发优化提升连接成功率、速度等
- Is smart park the trend of future development?
- Best Cow Fences 题解
- 我该如何理解工艺
- The local area network cannot access the Apache server
- LeetCode每日一练 —— 剑指Offer 56 数组中数字出现的次数
猜你喜欢

Leetcode daily practice - 160. Cross linked list

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

Im im development optimization improves connection success rate, speed, etc

HyperMesh auto save (enhanced) plug-in instructions

Some suggestions on optimizing HyperMesh script performance

egg(十九):使用egg-redis性能优化,缓存数据提升响应效率

ANSA二次开发 - Visual Studio Code上搭建ANSA二次开发环境

小程序:获取元素节点信息

Ansa secondary development - build ansa secondary development environment on Visual Studio code

Interesting kotlin 0x09:extensions are resolved statically
随机推荐
"Wei Lai Cup" 2022 Niuke summer multi school training camp 3 acfhj
13 differences between MySQL and Oracle
排序3-选择排序与归并排序(递归实现+非递归实现)
阿里大哥教你如何正确认识关于标准IO缓冲区的问题
FX3开发板 及 原理图
Simple addition, deletion, modification and query of commodity information
Tcp/ip related
Analysis of echo service model in the first six chapters of unp
First day of QT study
Configure HyperMesh secondary development environment on vs Code
nowcode-学会删除链表中重复元素两题(详解)
我该如何理解工艺
【深度学习】:《PyTorch入门到项目实战》第五天:从0到1实现Softmax回归(含源码)
Best Cow Fences 题解
Microsoft question 100 - do it every day - question 11
Leetcode learn complex questions with random pointer linked lists (detailed explanation)
有趣的 Kotlin 0x0A:Fun with composition
Asp.net large file block upload breakpoint resume demo
Implementation of transfer business
HM二次开发 - Data Names及其使用