当前位置:网站首页>NiO knowledge points
NiO knowledge points
2022-07-24 10:14:00 【Pupils learning programming】
One 、NIO brief introduction
1)Java 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 this connection doesn't do anything, it will cause unnecessary thread overhead .
2)Java NIO : Synchronous nonblocking , The server implementation mode deals with multiple requests for one thread ( Connect ), That is, the connection requests sent by the client will be registered on the multiplexer , The multiplexer polls the connection to have I/O The request is processed .
Two 、 Several concepts of operating system
1、 Kernel state and user state
Kernel mode :cpu Access to all data in memory , Including peripherals , For example, hard disk , network card ,CUP You can also switch from one program to another .
User mode : Only limited access to memory , And access to peripherals is not allowed , Occupy CPU The ability to be deprived of .
Why do you want to use user state and kernel state ?
Because it is necessary to restrict the access ability between different programs , To prevent other programs from accessing memory , Or get peripheral data , And send it to the network , CPU There are two levels of authority – User mode and kernel mode .
When will the switch between kernel mode and user mode occur ?
【 When the user mode needs to apply for external resources, it will switch to the kernel mode 】. For example, execute system calls 、 It's happening
边栏推荐
- [STM32 learning] (6) use of serial port 1 (usart1)
- Is it safe for Oriental Fortune futures to open an online account, and will it be cheated?
- CAS principle [concurrent programming]
- zoj-Swordfish-2022-5-6
- [STM32 learning] (17) STM32 realizes LCD12864 display serial implementation
- Source insight 3.5 comment garbled
- Exception: pyqtgraph requires Qt version >= 5.12 (your version is 5.9.5)
- Add a love power logo to your website
- Query about operating system security patch information
- Sub query of multi table query_ Single row and single column
猜你喜欢

What is the cloud native mid platform business architecture?
![CAS principle [concurrent programming]](/img/f0/77e7e1079f70198c601b0f1e25106e.png)
CAS principle [concurrent programming]

Development history of the first commercial humanoid biped robot in China

关联规则--2022年7月10日

An article takes you to understand the operation of C language files in simple terms

Curse of knowledge
![[STM32 learning] (11) STM32 Mifare_ Use of one (S50) m1s50 (read, write, key modification, control bit interpretation)](/img/fd/4290525914b5146fe0eb653517fef9.png)
[STM32 learning] (11) STM32 Mifare_ Use of one (S50) m1s50 (read, write, key modification, control bit interpretation)

Tencent 5g innovation center was established, laying out key directions such as unmanned ports, smart mines and E-sports events
![[STM32 learning] (18) STM32 realizes LCD12864 display - parallel implementation of 8-bit bus](/img/6b/b49b9e7fff62026a4818561d79fe3f.png)
[STM32 learning] (18) STM32 realizes LCD12864 display - parallel implementation of 8-bit bus

String__
随机推荐
Centos7 install mysql8.0
Mysql database JDBC programming
Application of for loop
Set scrolling for the box
Query about operating system security patch information
Interpretation of websocket protocol -rfc6455
cannot unpack non-iterable NoneType object
脚手架内各文件配置说明、组件化开发步骤
JS bind simulation
JMeter setting default startup Chinese
Arduino drive Lora module node
[robot learning] mechanism kinematics analysis and MATLAB simulation (3D model +word report +matlab program)
MySQL status view qps/tps/ cache hit rate view
给你的网站加一个爱发电角标
第五章 修改实现(IMPL)类
Gaode map
Websocket 协议解读-RFC6455
What did zoneawareloadbalancer of ribbon and its parent class do?
The best time to buy and sell stocks Ⅲ (leetcode-123)
Dynamic planning: robbing families and houses