当前位置:网站首页>四次挥手的Socket交互流程
四次挥手的Socket交互流程
2022-07-27 20:43:00 【华为云】
然后是四次挥手的Socket交互流程。
某个应用进程调用 close() 主动关闭,发送一个 FIN;
另一端接收到 FIN 后被动执行关闭,并发送 ACK 确认;
之后被动执行关闭的应用进程调用 close() 关闭 Socket,并也发送一个 FIN;
接收到这个 FIN 的一端向另一端 ACK 确认。
有哪些磁盘调度算法?
先来先服务
按照磁盘请求的顺序进行调度。
优点是公平和简单。缺点也很明显,因为未对寻道做任何优化,使平均寻道时间可能较长。
最短寻道时间优先
优先调度与当前磁头所在磁道距离最近的磁道。
虽然平均寻道时间比较低,但是不够公平。如果新到达的磁道请求总是比一个在等待的磁道请求近,那么在等待的磁道请求会一直等待下去,也就是出现饥饿现象。一般来说,两端的磁道请求更容易出现饥饿现象。
电梯算法
也叫SCAN扫描算法。电梯算法就是说读写磁头总是保持一个方向运行,直到该方向没有请求为止,然后改变运行方向。
因为考虑了移动方向,因此所有的磁盘请求都会被满足,解决了最短寻道时间优先的饥饿问题。
什么是虚拟内存?
虚拟内存就是说,让物理内存扩充成更大的逻辑内存,从而让程序获得更多的可用内存。虚拟内存使用部分加载的技术,让一个进程或者资源的某些页面加载进内存,从而能够加载更多的进程,甚至能加载比内存大的进程,这样看起来好像内存变大了,这部分内存其实包含了磁盘或者硬盘,并且就叫做虚拟内存。
什么是分页系统?
分页就是说,将磁盘或者硬盘分为大小固定的数据块,叫做页,然后内存也分为同样大小的块,叫做页框。当进程执行的时候,会将磁盘的页载入内存的某些页框中,并且正在执行的进程如果发生缺页中断也会发生这个过程。页和页框都是由两个部分组成的,一个是页号或者页框号,一个是偏移量。分页一般是有硬件来完成的,每个页都对应一个页框,它们的对应关系存放在一个叫做页表的数据结构中,页号作为这个页表的索引,页框号作为页表的值。操作系统负责维护这个页表。
分页和分段有什区别?
分页对程序员是透明的,但是分段需要程序员显式划分每个段。
分页的地址空间是一维地址空间,分段是二维的。
页的大小不可变,段的大小可以动态改变。
分页主要用于实现虚拟内存,从而获得更大的地址空间;分段主要是为了使程序和数据可以被划分为逻辑上独立的地址空间并且有助于共享和保护。
页面替换算法有哪些?
在程序运行过程中,如果要访问的页面不在内存中,就发生缺页中断从而将该页调入内存中。此时如果内存已无空闲空间,系统必须从内存中调出一个页面到磁盘对换区中来腾出空间。
最佳算法
所选择的被换出的页面将是最长时间内不再被访问,通常可以保证获得最低的缺页率。这是一种理论上的算法,因为无法知道一个页面多长时间不再被访问。
先进先出
选择换出的页面是最先进入的页面。该算***将那些经常被访问的页面也被换出,从而使缺页率升高。
边栏推荐
- Interviewer: I can't carry a backpack at all. Are you going by yourself or I'll give you a lift?
- Promise solves asynchrony
- 2022/7/24-7/25
- Introduction to the paper | language model for long text under transformer architecture
- 台积电3nm细节曝光:晶体管密度高达2.5亿个/mm²,性能及能效大幅提升
- Cloudcompare & PCL point cloud equally spaced slices
- Excel only wants to visualize charts and make data move? Yes, come and watch (with a large number of templates to download)
- 小程序容器技术超有料,可以让移动研发效率大幅提升
- After returning to mixlab for three days, "creative team" cured my spiritual internal friction
- The prefix is not removed when zuul gateway automatically routes
猜你喜欢

Flink怎么使用Savepoint

Read an article to understand artificial neural network

Dry goods semantic web, Web3.0, Web3, metauniverse, these concepts are still confused? (medium)

如何快捷地查看H.265视频播放器EasyPlayer的API属性及其使用方法?

Learn more about xxE injection

WWW 2019 | HAN:异质图注意力网络

After returning to mixlab for three days, "creative team" cured my spiritual internal friction
![[signal processing] weak signal detection in communication system based on the characteristics of high-order statistics with matlab code](/img/a7/8f0d929457d285adc8020c7f5d33ea.png)
[signal processing] weak signal detection in communication system based on the characteristics of high-order statistics with matlab code

How to quickly view the API properties and usage of the h.265 video player easyplayer?

iMeta | 国际标准刊号ISSN印刷版正式确认,双ISSN申请完成
随机推荐
XML 外部实体 (XXE) 漏洞及其修复方法
Bubbling, fast sorting, heap sorting and cardinality sorting of the eight sorts
The principle and demonstration of service path lifting without quotation marks
Www 2019 | Han: heterograph attention network
Basic SQL DQL
Deploy dolphin scheduler high availability cluster based on rainbow
What are the advantages of Tita's OKR system over other similar products or shared documents?
The security dilemma of software supply chain faced by enterprises
The prefix is not removed when zuul gateway automatically routes
NDK series (6): let's talk about the way and time to register JNI functions
VIM editor tutorial
Nature综述:微生物群落形成过程中的优先效应
Cloud native enthusiast weekly: a complete collection of client go examples
Cron expression
怎么使用C# Winform实现复制文件显示进度
[image defogging] image defogging based on dark channel and non-mean filtering with matlab code
Visual display method of machine learning project
Network development socket and UDP, TCP protocols
Bi Shi - University Logistics Management System Based on SSM
使用灰度滤镜