当前位置:网站首页>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 .
边栏推荐
- LeetCode-学会对无序链表进行插入排序(详解)
- 【从零开始学习SLAM】将坐标系变换关系发布到 topic tf
- leetcode9. 回文数
- 队列的介绍与实现(详解)
- 排序3-选择排序与归并排序(递归实现+非递归实现)
- What does it remote operation and maintenance mean? Which is the best remote operation and maintenance software?
- Li Hongyi, machine learning 4. Deep learning
- 排序4-堆排序与海量TopK问题
- [learn slam from scratch] publish the coordinate system transformation relationship to topic TF
- Nowcode- learn to delete duplicate elements in the linked list (detailed explanation)
猜你喜欢

Sort 5-count sort

Kubeedge releases white paper on cloud native edge computing threat model and security protection technology

有趣的 Kotlin 0x07:Composition

Sort 1-insert sort and Hill sort

【深度学习】:《PyTorch入门到项目实战》第九天:Dropout实现(含源码)

有趣的 Kotlin 0x0A:Fun with composition

Learn ABAQUS script programming script in an hour

每一个账号对应所有密码,再每一个密码对应所有账号暴力破解代码怎么写?...

排序3-选择排序与归并排序(递归实现+非递归实现)

Interesting kotlin 0x06:list minus list
随机推荐
每一个账号对应所有密码,再每一个密码对应所有账号暴力破解代码怎么写?...
有趣的 Kotlin 0x07:Composition
Fx3 development board and schematic diagram
有趣的 Kotlin 0x0A:Fun with composition
PHP calculate coordinate distance
FX3开发板 及 原理图
“蔚来杯“2022牛客暑期多校训练营3 ACFHJ
Brother Ali teaches you how to correctly understand the problem of standard IO buffer
nowcode-学会删除链表中重复元素两题(详解)
Sort 2 bubble sort and quick sort (recursive and non recursive explanation)
“蔚来杯“2022牛客暑期多校训练营3 A.Ancestor LCA+暴力计数
TCP handshake, waving, time wait connection reset and other records
LwIP develops | socket | TCP | keepalive heartbeat mechanism
Optimization of network request success rate in IM instant messaging software development
Interesting kotlin 0x08:what am I
"Wei Lai Cup" 2022 Niuke summer multi school training camp 3 acfhj
UNP前六章 回射服务模型 解析
有趣的 Kotlin 0x08:What am I
给定正整数N、M,均介于1~10 ^ 9之间,N <= M,找出两者之间(含N、M)的位数为偶数的数有多少个
Kubeedge releases white paper on cloud native edge computing threat model and security protection technology