当前位置:网站首页>腾讯总考epoll, 很烦
腾讯总考epoll, 很烦
2022-07-01 12:33:00 【涛歌依旧】
腾讯面试每次都考epoll, 说真的,很烦。
很多面试官自己的知识不进化,天天只记得个epoll, 还说什么呢?
[email protected]:~$ man epoll
EPOLL(7) Linux Programmer's Manual EPOLL(7)
NAME
epoll - I/O event notification facility
SYNOPSIS
#include <sys/epoll.h>
DESCRIPTION
The epoll API performs a similar task to poll(2): monitoring multiple file descriptors to see if I/O is possible on any of
them. The epoll API can be used either as an edge-triggered or a level-triggered interface and scales well to large num[m
bers of watched file descriptors. The following system calls are provided to create and manage an epoll instance:
* epoll_create(2) creates an epoll instance and returns a file descriptor referring to that instance. (The more recent
epoll_create1(2) extends the functionality of epoll_create(2).)
* Interest in particular file descriptors is then registered via epoll_ctl(2). The set of file descriptors currently reg[m
istered on an epoll instance is sometimes called an epoll set.
* epoll_wait(2) waits for I/O events, blocking the calling thread if no events are currently available.
Level-triggered and edge-triggered
The epoll event distribution interface is able to behave both as edge-triggered (ET) and as level-triggered (LT). The dif[m
ference between the two mechanisms can be described as follows. Suppose that this scenario happens:
1. The file descriptor that represents the read side of a pipe (rfd) is registered on the epoll instance.
2. A pipe writer writes 2 kB of data on the write side of the pipe.
3. A call to epoll_wait(2) is done that will return rfd as a ready file descriptor.
4. The pipe reader reads 1 kB of data from rfd.
5. A call to epoll_wait(2) is done.其实,这就是八股文题目,没啥意思。
边栏推荐
- Blue Bridge Cup multi interface switching processing (enumeration plus state machine method)
- ASTM D 3801固体塑料垂直燃烧试验
- 使用BurpSuite对app抓包教程
- 【20211129】Jupyter Notebook远程服务器配置
- Queue operation---
- [some notes]
- Huawei interview question: Recruitment
- [20220605] Literature Translation -- visualization in virtual reality: a systematic review
- [Yunju entrepreneurial foundation notes] Chapter 7 Entrepreneurial Resource test 8
- [speech signal processing] 3 speech signal visualization -- prosody
猜你喜欢

【datawhale202206】pyTorch推荐系统:多任务学习 ESMM&MMOE

Onenet Internet of things platform - mqtt product equipment upload data points

Machine learning - Data Science Library Day 3 - Notes
![[Yunju entrepreneurial foundation notes] Chapter 7 Entrepreneurial Resource test 3](/img/ea/c5e8d12007873385fa0d197fa62fd2.jpg)
[Yunju entrepreneurial foundation notes] Chapter 7 Entrepreneurial Resource test 3

【datawhale202206】pyTorch推荐系统:精排模型 DeepFM&DIN

Typora realizes automatic uploading of picture pasting

《MATLAB 神经网络43个案例分析》:第40章 动态神经网络时间序列预测研究——基于MATLAB的NARX实现

Sort out relevant contents of ansible

VS Code 设置单击打开新文件窗口,不覆盖前一个窗口

Machine learning - Data Science Library - day two
随机推荐
2022-06-28-06-29
91.(cesium篇)cesium火箭發射模擬
Efforts at the turn of the decade
【脑洞大开】《西潮》及《走向世界丛书》
Exploration and practice of inress in kubernetes
GID: open vision proposes a comprehensive detection model knowledge distillation | CVPR 2021
6.30 simulation summary
Chained storage of queues
Onenet Internet of things platform - mqtt product devices send messages to message queues MQ
MySQL workbench data modeling function
[20211129] jupyter notebook remote server configuration
Ipv6-6to4 experiment
Tencent security and KPMG released a regulatory technology white paper to analyze the "3+3" hot application scenarios
JS reverse | m3u8 data decryption of a spring and autumn network
Typora realizes automatic uploading of picture pasting
Typora adds watermarks to automatically uploaded pictures
kubernetes之ingress探索实践
比特熊直播间一周年,英雄集结令!邀你来合影!
Double linked list related operations
【20211129】Jupyter Notebook远程服务器配置