当前位置:网站首页>腾讯总考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.其实,这就是八股文题目,没啥意思。
边栏推荐
- Tencent Li Wei: deeply cultivate "regulatory technology" to escort the steady and long-term development of the digital economy
- BIM and safety in road maintenance-buildSmart Spain
- Huawei interview question: Recruitment
- Zero copy technology of MySQL
- Wechat applet - 80 practical examples of wechat applet projects
- Queue operation---
- 双链表有关操作
- "Analysis of 43 cases of MATLAB neural network": Chapter 40 research on prediction of dynamic neural network time series -- implementation of NARX based on MATLAB
- First intention is the most important
- 【20211129】Jupyter Notebook遠程服務器配置
猜你喜欢

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

Joint Time-Frequency and Time Domain Learning for Speech Enhancement

91. (chapitre Cesium) simulation de lancement de fusées cesium

Ansible相关内容梳理

Sort out relevant contents of ansible

队列的链式存储
![[brain opening] west tide and going to the world series](/img/b2/444af296e170d19629800b3d4c50fa.jpg)
[brain opening] west tide and going to the world series

How to use opcache, an optimization acceleration component of PHP

Build yocto system offline for i.mx8mmini development board

Typora realizes automatic uploading of picture pasting
随机推荐
[JS advanced] promise explanation
双链表有关操作
[Suanli network] technological innovation of Suanli Network -- key technology of operation service
【语音信号处理】3语音信号可视化——prosody
《MATLAB 神经网络43个案例分析》:第40章 动态神经网络时间序列预测研究——基于MATLAB的NARX实现
Using burpsuite to capture app packages
What are the PHP FPM configuration parameters
Relationship between accuracy factor (DOP) and covariance in GPS data (reference link)
Fatal error: execution: there is no such file or directory
Compile and debug net6 source code
[Maui] add click events for label, image and other controls
leetcode 406. Queue reconstruction by height
【20220605】文献翻译——虚拟现实中的可视化:一个系统的回顾
比特熊直播间一周年,英雄集结令!邀你来合影!
91.(cesium篇)cesium火箭發射模擬
[Yunju entrepreneurial foundation notes] Chapter 7 Entrepreneurial Resource test 7
Machine learning - Data Science Library - day two
Ansi/ul 94 VTM vertical burning test for thin materials
[speech signal processing] 3 speech signal visualization -- prosody
【datawhale202206】pyTorch推荐系统:召回模型 DSSM&YoutubeDNN