当前位置:网站首页>面试百分百问到的进程,你究竟了解多少
面试百分百问到的进程,你究竟了解多少
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
边栏推荐
- Summary according to classification in sail software
- MySQL master-slave synchronization pit avoidance version tutorial
- Query the data from 2013 to 2021, and only query the data from 2020. The solution to this problem is carried out
- 七朋元视界可信元宇宙社交体系满足多元化的消费以及社交需求
- logback的配置文件加载顺序
- Use itextpdf to intercept the page to page of PDF document and divide it into pieces
- Deepinv20 installation MariaDB
- Day 9 static abstract class interface
- Day (2) of picking up matlab
- Qipengyuan horizon credible meta universe social system meets diversified consumption and social needs
猜你喜欢
Cartoon: what are IAAs, PAAS, SaaS?
What is the experience of using prophet, an open source research tool?
Using JSON server to create server requests locally
Countdown 1 day ~ 2022 online conference of cloud disaster tolerance products is about to begin
Phpstudy V8, a commonly used software for station construction 1 graphic installation tutorial (Windows version) super detailed
Kunteng full duplex digital wireless transceiver chip kt1605 / kt1606 / kt1607 / kt1608 is suitable for interphone scheme
VMware Workstation cannot connect to the virtual machine. The system cannot find the specified file
建站常用软件PhpStudy V8.1图文安装教程(Windows版)超详细
Hyperbdr cloud disaster recovery v3 Version 2.1 release supports more cloud platforms and adds monitoring and alarm functions
Installation and management procedures
随机推荐
伪分布安装spark
力扣-198.打家劫舍
Qipengyuan horizon credible meta universe social system meets diversified consumption and social needs
Use itextpdf to intercept the page to page of PDF document and divide it into pieces
Using JSON server to create server requests locally
Day (4) of picking up matlab
NVIDIA显卡驱动报错
VIM uses vundle to install the code completion plug-in (youcompleteme)
Force buckle - 198 raid homes and plunder houses
安装及管理程序
Project framework of robot framework
关于 background-image 渐变gradient()那些事!
七朋元视界可信元宇宙社交体系满足多元化的消费以及社交需求
You need to know about cloud disaster recovery
Research and Practice on business system migration of a government cloud project
JSP learning 1
Set cell filling and ranking method according to the size of the value in the soft report
Download and install mongodb
Loading order of logback configuration file
DDT + Excel for interface test