当前位置:网站首页>面试百分百问到的进程,你究竟了解多少
面试百分百问到的进程,你究竟了解多少
2022-04-23 16:40:00 【yan扬】
操作系统(operating system,简称OS)是管理计算机硬件与软件资源的计算机程序。操作系统需要处理如管理与配置内存、决定系统资源供需的优先次序、控制输入设备与输出设备、操作网络与管理文件系统等基本事务。操作系统也提供一个让用户与系统交互的操作界面。
操作系统充斥在我们的生活工作中,比较常见的有Windows,Unix,Linux,Ios,鸿蒙等。
目录
四、CPU分配——进程调度(Process Scheduling)
一、操作系统的定位

操作系统的两个基本功能:
1、防止硬件被失控的应用程序滥用
2、向应用程序提供简单一致的机制来控制复杂并且通常大相径庭的硬件设备
二、什么是进程/任务
进程(Process)是计算机中的程序关于某数据集合上的一次运行活动,是系统进行资源分配和调度的基本单位,是操作系统结构的基础。在早期面向进程设计的计算机结构中,进程是程序的基本执行实体;在当代面向线程设计的计算机结构中,进程是线程的容器。程序是指令、数据及其组织形式的描述,进程是程序的实体。
进程是操作系统对一个正在运行的程序的一种抽象,换言之,可以把进程看做程序的一次运行过程

三、进程控制块抽象
计算机内部要管理任何现实事务,都需要将其抽象成一组有关联的,互为一体的数据。在JAVA中,我们可以通过 类/对象 来描述这一特征。
//以下代码是JAVA代码的伪代码形式,重在说明,无法直接运行
class PCB {
//进程的唯一标识 pid
//进程关联的程序信息,例如那个程序加载到内存中的区域等
//分配给该资源使用的各个资源
//进度调度信息
}
这样,每一个PCB对象就代表一个实实在在的程序,也就是进程。
操作系统再通过这种数据结构,例如线性表,搜索树等将PCB对象组织起来,方便管理 时进行增删查改的操作
四、CPU分配——进程调度(Process Scheduling)
为了便于讨论和理解,我们大部分的场景下假设是单CPU单核的计算机
操作系统对CPU资源的分配,采用的是时间模式——不同的线程在不同的时间段去使用CPU资源。

并行vs并发 内核态vs用户态:


五、内存分配——内存管理
操作系统对内存资源的分配,采用的是空间模式——不同进程使用内存中的不同区域,互相之间不会干扰


六、进程间通信
如上所述,进程是操作系统进行资源分配的最小单位,这意味着各个进程互相之间无法感受到对方的存在,这就是操作系统抽象出进程这一概念的初衷,这样带来了进程之间具备“隔离性”。
但现代的应用,要完成一个复杂的业务需求,往往无法通过一个进程独立完成,总是需要进程之间相互配合,因此,进程之间就有”信息交换“的需求。进程间通信的需求就应运而生。
目前,主流操作系统提供的进程间通信机制有如下:
1、管道
2、共享内存
3、文件
4、网络
5、信号量
6、信号
其中,网络是一种相对特殊的IPC机制,他除了支持同主机两个进程间通信,还支持同一网络内部非同一主机上的进程间进行通信。
版权声明
本文为[yan扬]所创,转载请带上原文链接,感谢
https://blog.csdn.net/qq_59539549/article/details/124326492
边栏推荐
- Government cloud migration practice: Beiming digital division used hypermotion cloud migration products to implement the cloud migration project for a government unit, and completed the migration of n
- Report FCRA test question set and answers (11 wrong questions)
- Use case execution of robot framework
- JMeter installation tutorial and solutions to the problems I encountered
- How to quickly batch create text documents?
- Loading order of logback configuration file
- UWA Pipeline 功能详解|可视化配置自动测试
- Hypermotion cloud migration completes Alibaba cloud proprietary cloud product ecological integration certification
- 聊一聊浏览器缓存控制
- Esxi encapsulated network card driver
猜你喜欢

Review 2021: how to help customers clear the obstacles in the last mile of going to the cloud?

Take according to the actual situation, classify and summarize once every three levels, and see the figure to know the demand

Summary according to classification in sail software

Day (5) of picking up matlab

G008-hwy-cc-estor-04 Huawei Dorado V6 storage simulator configuration

100 deep learning cases | day 41 - convolutional neural network (CNN): urbansound 8K audio classification (speech recognition)

Nacos detailed explanation, something

Gartner 發布新興技術研究:深入洞悉元宇宙

DanceNN:字节自研千亿级规模文件元数据存储系统概述

Kunteng full duplex digital wireless transceiver chip kt1605 / kt1606 / kt1607 / kt1608 is suitable for interphone scheme
随机推荐
Loading order of logback configuration file
Phpstudy V8, a commonly used software for station construction 1 graphic installation tutorial (Windows version) super detailed
Esxi encapsulated network card driver
Use itextpdf to intercept the page to page of PDF document and divide it into pieces
Set the color change of interlaced lines in cells in the sail software and the font becomes larger and red when the number is greater than 100
关于局域网如何组建介绍
关于 background-image 渐变gradient()那些事!
How to choose the wireless gooseneck anchor microphone and handheld microphone scheme
logback的配置文件加载顺序
loggie 源码分析 source file 模块主干分析
Gartner announces emerging technology research: insight into the meta universe
The most detailed knapsack problem!!!
LVM与磁盘配额
Questions about disaster recovery? Click here
5-minute NLP: text to text transfer transformer (T5) unified text to text task model
计组 | 【七 输入/输出系统】知识点与例题
JIRA screenshot
最详细的背包问题!!!
Set cell filling and ranking method according to the size of the value in the soft report
Detailed explanation of gzip and gunzip decompression parameters
