当前位置:网站首页>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 .
边栏推荐
- It only takes two steps to find the right PMP organization, one check and two questions
- 如何抑制SiC MOSFET Crosstalk(串擾)?
- 图解MySQL的binlog、redo log和undo log
- Protection range and optimization of motor protector for hoist equipment
- Not so Mobile
- Import and export of a single collection in postman
- Copy & Deepcopy
- 股票 停牌
- Robot Rapping Results Report
- Data mining modeling practice
猜你喜欢
Comment supprimer le crosstalk SiC MOSFET?
Learn how Alibaba manages the data indicator system
How to solve the problem of high concurrency and seckill
Implementation of code scanning login
What are the advantages of a differential probe over a conventional probe
Discussion on the improvement and application of the prepayment system in the management of electricity charge and price
Superimposed ladder diagram and line diagram and merged line diagram and needle diagram
Lilda low code data large screen, leveling the threshold of data application development
STL - inverter
SQL注入之文件读写
随机推荐
From knowledge to wisdom: how far will the knowledge map go?
中金财富开户安全吗?怎么收费?
Power data
Illustration of MySQL binlog, redo log and undo log
利尔达低代码数据大屏,铲平数据应用开发门槛
学习阿里如何进行数据指标体系的治理
How to implement two factor authentication MFA based on RADIUS protocol?
Use of Jasper soft studio report tool and solution of thorny problems
网上炒股开户安不安全?
Basic content learning of software testing (I)
图解MySQL的binlog、redo log和undo log
Discussion on safety management of centralized maintenance construction site of substation under the mode of operation and maintenance
AVFrame内存管理api
Discussion on the practice of fire emergency lighting system in the field of building electrical design
华泰证券网上开户安全吗 办理流程是什么
Installation of containerd1.5.5
Build the first neural network with pytoch and optimize it
temple
JMeter -- interface test 2
【云原生 | Kubernetes篇】深入了解Pod(六)