当前位置:网站首页>面试百分百问到的进程,你究竟了解多少
面试百分百问到的进程,你究竟了解多少
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
边栏推荐
- Introduction notes to PHP zero Foundation (13): array related functions
- 5分钟NLP:Text-To-Text Transfer Transformer (T5)统一的文本到文本任务模型
- loggie 源码分析 source file 模块主干分析
- Six scenarios of cloud migration
- 299. Number guessing game
- Review 2021: how to help customers clear the obstacles in the last mile of going to the cloud?
- Detailed explanation of UWA pipeline function | visual configuration automatic test
- English | day15, 16 x sentence true research daily sentence (clause disconnection, modification)
- Best practice of cloud migration in education industry: Haiyun Jiexun uses hypermotion cloud migration products to implement progressive migration for a university in Beijing, with a success rate of 1
- File upload and download of robot framework
猜你喜欢
The first line and the last two lines are frozen when paging
阿里研发三面,面试官一套组合拳让我当场懵逼
RecyclerView advanced use - to realize drag and drop function of imitation Alipay menu edit page
Gartner predicts that the scale of cloud migration will increase significantly; What are the advantages of cloud migration?
Review 2021: how to help customers clear the obstacles in the last mile of going to the cloud?
Cloud migration practice in the financial industry Ping An financial cloud integrates hypermotion cloud migration solution to provide migration services for customers in the financial industry
How to choose the wireless gooseneck anchor microphone and handheld microphone scheme
NVIDIA显卡驱动报错
Pycham connects to the remote server and realizes remote debugging
Selenium IDE and XPath installation of chrome plug-in
随机推荐
How to build tiktok user trust and drive fan growth
Public variables of robotframework
MySQL的btree索引和hash索引区别
On the security of key passing and digital signature
如何建立 TikTok用户信任并拉动粉丝增长
力扣-746.使用最小花费爬楼梯
计组 | 【七 输入/输出系统】知识点与例题
阿里研发三面,面试官一套组合拳让我当场懵逼
New project of OMNeT learning
Use case labeling mechanism of robot framework
UWA Pipeline 功能详解|可视化配置自动测试
OMNeT学习之新建工程
Creation of RAID disk array and RAID5
JIRA screenshot
LVM and disk quota
Server log analysis tool (identify, extract, merge, and count exception information)
Hypermotion cloud migration helped China Unicom. Qingyun completed the cloud project of a central enterprise and accelerated the cloud process of the group's core business system
Download and install mongodb
Query the data from 2013 to 2021, and only query the data from 2020. The solution to this problem is carried out
Six scenarios of cloud migration