当前位置:网站首页>NIO知识点
NIO知识点
2022-07-24 10:06:00 【正在学习编程的小学生】
一、NIO简介
1)Java BIO : 同步并阻塞(传统阻塞型),服务器实现模式为一个连接一个线程,即客户端有连接请求时服务器端就需要启动一个线程进行处理,如果这个连接不做任何事情会造成不必要的线程开销。
2)Java NIO : 同步非阻塞,服务器实现模式为一个线程处理多个请求(连接),即客户端发送的连接请求都会注册到多路复用器上,多路复用器轮询到连接有I/O请求就进行处理。
二、操作系统的几个概念
1、内核态和用户态
内核态:cpu可以访问内存的所有数据,包括外围设备,例如硬盘,网卡,CUP也可以将自己从一个程序切换到另一个程序。
用户态:只能受限的访问内存,且不允许访问外围设备,占用CPU的能力被剥夺。
为什么要有用户态和内核态?
因为需要限制不同的程序之间的访问能力, 防止他们获取别的程序的内存数据, 或者获取外围设备的数据, 并发送到网络, CPU划分出两个权限等级 – 用户态和内核态。
什么时候会发生内核态和用户态的切换?
【用户态在需要申请外部资源的时候会切换至内核态】。比如执行系统调用、发生中
边栏推荐
- Deployment and analysis of coredns
- CRC Coding in C language
- Arduino drive lcd1602a
- [STM32 learning] (14) two 74HC595 controls four nixie tube displays
- 2022, enterprise informatization construction based on Unified Process Platform refers to thubierv0.1
- PHP log base - monolog knowledge collation
- CAS principle [concurrent programming]
- AttributeError: module ‘sipbuild. api‘ has no attribute ‘prepare_ metadata_ for_ build_ wheel‘
- The heads of the five major international institutions called for urgent action to deal with the global food security crisis
- Where is the bitbucket clone address
猜你喜欢

Spark Learning: build SQL to meet the specified optimization rules
![[robot learning] mechanism kinematics analysis and MATLAB simulation (3D model +word report +matlab program)](/img/dd/d29a5be7306580ad388ba6487d230f.png)
[robot learning] mechanism kinematics analysis and MATLAB simulation (3D model +word report +matlab program)

Home raiding III (leetcode-337)

What is the cloud native mid platform business architecture?
![Cyclicbarrier and countdownlatch [concurrent programming]](/img/38/3305a0cdb6de40e1370cc93c8e5014.png)
Cyclicbarrier and countdownlatch [concurrent programming]

Embedded development: Tools - optimizing firmware using DRT
![[200 opencv routines] 236. Principal component analysis of feature extraction (openCV)](/img/31/57217a67533d8d37bf86d507996ed7.png)
[200 opencv routines] 236. Principal component analysis of feature extraction (openCV)

Linux deployment mysql8.0

What did zoneawareloadbalancer of ribbon and its parent class do?

Analysis of Kube proxy IPVS mode
随机推荐
How does SRE and development of Google cooperate
Spark Learning: using RDD API to implement inverted index
Raspberry Pie: the serial port has been unable to read the information sent by the upper computer
Value on the object Z rotation synchronization panel in unity
[STM32 learning] (18) STM32 realizes LCD12864 display - parallel implementation of 8-bit bus
Get the historical quotation data of all stocks
LiteOS_ a - SYS_ The run() function is missing a header file.
[STM32 learning] (22) STM32 realizes 360 degree rotary encoder
Curse of knowledge
The best time to buy and sell stocks includes handling charges (leetcode-714)
07 Jason module
Recursion - if the function calls itself internally, then the function is a recursive function & the effect is the same as that of the loop & the push condition return should be added, otherwise stack
Implementation and traversal of binary tree and binary tree sorting tree
Spark Learning: compile spark source code in win10
Spark Learning: implement compact table command
[STM32 learning] (9) stm32f1 general timer realizes simple breathing lamp
Ribbon's loadbalancerclient, zoneawareloadbalancer and zoneavoidancerule are three musketeers by default
Why add where exists() to the update select statement? And update with a with statement
Development history of the first commercial humanoid biped robot in China
Implementation principle of acid in MySQL