当前位置:网站首页>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 .
边栏推荐
- Use of Jasper soft studio report tool and solution of thorny problems
- How to solve the problem of high concurrency and seckill
- Discussion on the improvement and application of the prepayment system in the management of electricity charge and price
- 隐私计算FATE-----离线预测
- Privacy computing fat----- offline prediction
- "Jianzhi offer" -- Interview Question 4: finding two-dimensional arrays
- 电子元器件销售ERP管理系统哪个比较好?
- How to implement two factor authentication MFA based on RADIUS protocol?
- Matlab tips (20) matrix analysis -- principal component regression
- Loggerfactory uses log4j Parameter introduction of properties
猜你喜欢
![[.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](/img/19/296f124becb87461accf8b73b0a8bc.png)
[.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

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

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

Data mining modeling practice

How to solve the problem of high concurrency and seckill

Almost union find (weighted union search)

MATLAB小技巧(20)矩阵分析--主成分回归

Characteristics and prevention of electrical fire

rman备份报ORA-19809 ORA-19804

STL -- binder
随机推荐
Characteristics and prevention of electrical fire
SQL injection file read / write
Deployment of MySQL database in Linux Environment
From knowledge to wisdom: how far will the knowledge map go?
Privacy computing fat----- offline prediction
redis5.0的槽点迁移,随意玩(单机迁移集群)
Super Jumping! Jumping! Jumping!
华泰证券网上开户安全吗 办理流程是什么
Decision table method for basic content learning of software testing (2)
【.NET6】gRPC服务端和客户端开发案例,以及minimal API服务、gRPC服务和传统webapi服务的访问效率大对决
Apache Doris 成为 Apache 顶级项目
Discussion on the improvement and application of the prepayment system in the management of electricity charge and price
Key points of building fire protection design
Learn how Alibaba manages the data indicator system
【无标题】
Power data
How to solve the problem of high concurrency and seckill
Protection range and optimization of motor protector for hoist equipment
Superimposed ladder diagram and line diagram and merged line diagram and needle diagram
centos mysql5.5配置文件在哪