当前位置:网站首页>Understanding the IO model
Understanding the IO model
2022-06-28 09:03:00 【Know what you know】
BIO
Synchronize and block ( Traditional obstructive type ), The server implements a pattern of one thread per connection , That is, when the client has a connection request, the server needs to start a thread for processing , If the connection does nothing, it will cause unnecessary thread overhead .

NIO
Synchronous nonblocking , The server implementation mode deals with multiple requests for one thread ( Connect ), That is, the connection request sent by the client will be registered on the multiplexer , Multiplexer polled for I/O The request will be processed .

Selector
Selector The multiplexer is right linux Under the select/poll/epoll encapsulate ,selector There can be multiple implementations ,linux By default, the system uses epoll How to implement .
- Java Of NIO Non blocking I/O The way . You can handle several client connections with one thread , Will be used to Selector( Selectors ).
- Selector It can detect whether events occur on multiple registration channels ( Multiple Channel Register to the same as an event selector), If something happens , Then we get the events and deal with them accordingly .
- Only when there is a real read-write event in the connection , To read and write , Reduced system overhead , And you don't have to create a thread for each connection , No need to maintain multiple threads .
- Avoid the overhead caused by context switching between multiple threads .
AIO
Asynchronous non-blocking ,AIO The concept of asynchronous channel is introduced , Adopted Proactor Pattern , Simplified programming , Valid request to start thread , Its characteristic is to inform the server program to start the thread to process after the operating system completes , Generally, it is suitable for applications with more connections and longer connection time .
边栏推荐
- 手机炒股开户安不安全?
- Guangzhou: new financial activities and new opportunities for enterprises
- Common faults and solutions of Substation
- Android studio interview preparation
- How to solve the problem of port number occupation
- [.Net6] GRP server and client development cases, as well as the access efficiency duel between the minimum API service, GRP service and traditional webapi service
- FatMouse and Cheese
- Zhejiang energy online monitoring and management system
- Analysis of prepaid power purchase device
- Installation of containerd1.5.5
猜你喜欢

SQL 優化經曆:從 30248秒到 0.001秒的經曆

Webrtc advantages and module splitting

Data modeling based on wide table

"Jianzhi offer" -- Interview Question 4: finding two-dimensional arrays

硬盘基本知识(磁头、磁道、扇区、柱面)

It only takes two steps to find the right PMP organization, one check and two questions

Almost union find (weighted union search)

Error: `brew cask` is no longer a `brew` command. Use `brew <command> --cask` instead.

Discussion on the improvement and application of the prepayment system in the management of electricity charge and price

Using transform:scale causes the page mouse hover event to disappear
随机推荐
From knowledge to wisdom: how far will the knowledge map go?
小程序 :遍历list里面的某个数组的值,等同于 for=“list” list.comment里面的某一项
隐私计算FATE-----离线预测
[.Net6] GRP server and client development cases, as well as the access efficiency duel between the minimum API service, GRP service and traditional webapi service
Deployment of MySQL database in Linux Environment
FatMouse and Cheese
利尔达低代码数据大屏,铲平数据应用开发门槛
APICloud携手三六零天御,助力企业守好App安全“第一关”
Integer partition
DEJA_ Vu3d - 051 of cesium function set - perfect realization of terrain excavation
理解IO模型
罗氏线圈可以测量的大电流和频率范围
Tree
Goldbach`s Conjecture
Lilda low code data large screen, leveling the threshold of data application development
Implement global double finger long press to return to the desktop
如何抑制SiC MOSFET Crosstalk(串擾)?
Rich text - Test Case
Guangzhou: new financial activities and new opportunities for enterprises
State machine program framework