操作系统中的处理机调度调度_操作系统中的流程分类和调度

操作系统中的处理机调度调度

处理 (Process)

In the operating system, there are numerous task and application program run simultaneously. A program is stored in the hard disk or any other form of secondary storage. When the program is executed it must be loaded in the system’s memory. A process can be viewed as a program in execution. In the system, each process is assigned a unique Id when it is created and it will be referenced by the unique Id until the process completes execution and it is terminated. A process is an entity which performs the basic unit of work or one work at a time. We can say that a process is an instance of a computer program that is being executed. A process contains the program code and the activity that is going to be performed. when the computer program is in secondary memory then it is a passive entity or when a process is in main memory then it is an active entity. In the system, several processes may be associated with the same program.

在操作系统中,有许多任务和应用程序同时运行。 程序存储在硬盘或任何其他形式的辅助存储中。 执行程序时,必须将其加载到系统内存中。 可以将进程视为正在执行的程序。 在系统中,每个进程在创建时都会分配一个唯一的ID,并且唯一ID会引用该ID,直到该进程完成执行并终止为止。 流程是一次执行基本工作单元或一项工作的实体。 我们可以说一个进程是一个正在执行的计算机程序的实例。 一个过程包含程序代码和将要执行的活动。 当计算机程序位于辅助内存中时,它是一个被动实体,或者当进程位于主内存中时,它是一个主动实体。 在系统中,几个进程可能与同一程序相关联。

A process held a number of attributes like hardware, memory, CPU, and progress.

一个进程拥有许多属性,例如硬件,内存,CPU和进度。

Craft.io分类 (Process classification)

A process can be broadly categorized into the following two types based on its execution:

根据流程的执行情况,大致可将其分为以下两种类型:

  • I/O-Bound process

    I / O绑定过程

    An I/O-bound process is a process whose execution time is determined mainly by the amount of time it spends completing I/O operations.

    绑定到I / O的进程是其执行时间主要由其完成I / O操作所花费的时间确定的进程。

  • CPU-Bound process

    CPU绑定进程

    A CPU-bound process is a process whose execution time is determined by the speed of the CPU it runs on. A CPU-bound process can complete its execution faster if it is running on a faster processor.

    受CPU限制的进程是其执行时间取决于其运行的CPU速度的进程。 如果受CPU约束的进程在更快的处理器上运行,则可以更快地完成其执行。

    Note: There is a third category - Memory-bound process. However, since RAM serves as I/O for the processor, this can be considered as an instance of the I/O-bound process type.

    注意:第三类-内存绑定进程。 但是,由于RAM用作处理器的I / O,因此可以将其视为I / O绑定进程类型的实例。

Further a process can be broadly categorized into the following two types based on execution mode.

另外,基于执行模式,可以将处理大致分为以下两种。

Kernel mode: In the kernel mode, a process has unrestricted access to the system hardware it can execute privileges instruction and can access both user and kernel address space.

内核模式:在内核模式下,进程可以不受限制地访问系统硬件,它可以执行特权指令,并且可以访问用户和内核地址空间。

Example: Most of the device drivers in the system execute as kernel mode processes.

示例:系统中的大多数设备驱动程序都以内核模式进程执行。

User mode: In the user mode it has no direct access to the underlying system hardware it can only access its own user address space of other processes and it cannot execute privileged instructions.

用户模式:在用户模式下,它不能直接访问基础系统硬件,只能访问其他进程自己的用户地址空间,并且不能执行特权指令。

Example: web- browser is executed as a user- mode process.

示例: Web浏览器作为用户模式进程执行。

Craft.io调度 (Process scheduling)

On a computer system, there are often numerous processes that need to be executed simultaneously. Furthermore, the requests for resources necessary for their execution are made asynchronously. Therefore, to handle competing requests for resources including the processor, the OS employs a process scheduler. The process scheduler assigns each process the necessary resources and its turn for execution on the CPU. The decision to schedule a process is made by a scheduling algorithm. The scheduler maintains three queues, to schedule the processes.

在计算机系统上,通常有许多进程需要同时执行。 此外,异步执行对执行其所需的资源的请求。 因此,为了处理对包括处理器在内的资源的竞争请求,OS使用了进程调度程序。 进程调度程序为每个进程分配必要的资源及其轮流,以便在CPU上执行。 调度流程的决定由调度算法做出。 调度程序维护三个队列,以调度进程。

Job queue: The job queue is the set of all processes on the system.

作业队列:作业队列是系统上所有进程的集合。

Ready queue: The ready queue has all the processes that are loaded in main memory. These processes are ready and waiting for their turn to execute as soon as the CPU becomes available.

就绪队列:就绪队列具有所有加载到主内存中的进程。 这些进程已准备就绪,等待轮到CPU可用时立即执行。

Device queue: The set of processes waiting for an I/O device to become available, such as a printer. This queue is also known as the Blocked Queue.

设备队列:等待I / O设备变得可用的一组进程,例如打印机。 此队列也称为阻塞队列。

Process classification and scheduling in Operating System

流程执行 (Process Execution)

When a program is loaded into the memory (process memory) and it becomes a process and it can be divided into four sections, stack, heap, text and data.

当程序加载到内存(进程内存)中并成为一个进程时,可以分为四个部分:堆栈,堆,文本和数据。

Stack: The stack is used for local variables when the local variables are declared in the memory of some spaces on the stack is reserved for them.

堆栈:当局部变量在堆栈中某些空间的内存中被保留时,将堆栈用于局部变量。

Heap: The heap is used in the system for the dynamic memory allocation and it is managed by calls to new, delete, malloc, free like commands.

堆:堆在系统中用于动态内存分配,并且通过调用new,delete,malloc和free之类的命令进行管理。

Data section: The data section is made for of the global and the static variables when it is allocated and initialized prior to executing the main function.

数据部分:数据部分是在执行主功能之前进行分配和初始化时由全局变量和静态变量组成的。

Text section: The text section is made for the compiled program code when the program is launched it is read from non-volatile storage in the system.

文本部分:启动程序时,将从系统中的非易失性存储器中读取已编译的程序代码的文本部分。

Craft.io状态 (Process states)

When a process starts its execution it changes its states or goes through the various states. We can define a process states in parts by the current activity of that process. Each process may be in one or more in the states when it is executing.

当进程开始执行时,它会更改其状态或经历各种状态。 我们可以通过该过程的当前活动来部分定义一个过程状态。 每个进程在执行时可能处于一个或多个状态。

  1. New

    A process is in the new states when it is newly created in the system.

    在系统中新创建进程后,该进程将处于新状态。

  2. Ready

    准备

    When the process is created it move to the ready state and in this state, the process is ready for their execution.

    创建流程后,它将进入就绪状态,在此状态下,流程已准备好执行。

  3. Run

    A process in the running state when it is currently running process in the CPU. At a time only one process can be under execution in a single processor.

    当前正在CPU中运行的进程时,处于运行状态的进程。 一次只能在一个处理器中执行一个进程。

  4. Wait or block

    等待或封锁

    When the process is executed for I/O it moves to the wait or block state.

    当为I / O执行该过程时,它将进入等待或阻止状态。

  5. Terminated or completed

    终止或完成

    When the process completed its execution it enters into the terminated state. In this states, all the changes made by the process permanently save on the memory.

    进程完成执行后,将进入终止状态。 在这种状态下,该过程所做的所有更改将永久保存在内存中。

  6. Suspended ready

    暂停准备

    When the ready queue is full some process move to the suspend ready state so that there is no load on the ready queue.

    当就绪队列已满时,某些进程将移至暂挂就绪状态,以使就绪队列上没有负载。

  7. Suspended block

    悬浮块

    When the waiting queue is full some processes move to the suspend ready state so that there is no load on the block state.

    当等待队列已满时,某些进程将移至暂挂就绪状态,以便在块状态上没有负载。

A process is not itself a process it is actually a passive entity so its content is stored in the hard disk whereas a running process is a passive entity so the program counter counts the next instruction to be executed. In the system, two processes may be linked with the same program and these process cannot be considered as two separate processes. For any instances, many users may be running at the main program.

一个进程本身并不是一个进程,它实际上是一个被动实体,因此它的内容存储在硬盘中,而正在运行的进程是一个被动实体,因此程序计数器会计算下一条要执行的指令。 在系统中,两个进程可能与同一程序链接,并且这些进程不能视为两个单独的进程。 对于任何情况,许多用户可能正在主程序上运行。

翻译自: https://www.includehelp.com/operating-systems/process-classification-and-scheduling.aspx

操作系统中的处理机调度调度

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/380174.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

NX机制及绕过策略-ret2libc

程序&#xff1a; 1.c #include <stdio.h> void exploit() {system("/bin/sh"); } void func() {char str[0x20];read(0,str,0x50); } int main() {func();return 0; }0x01 NX介绍 溢出攻击的本质在于冯诺依曼计算机模型对数据和代码没有明确区分这一先天性缺…

【竞赛题解】第22次CCF计算机软件能力认证 B

今天&#xff08;准确说是昨天&#xff0c;一下子就过12点了&#xff09;下午刚参加了CSP认证考试&#xff0c;大概是考了220&#xff08;前两题AC&#xff0c;第三题太折磨了懒得看了&#xff0c;后面两题各混了10分&#xff09;&#xff0c;唯一有点参与感的就是B题了&#x…

gbd调试64位程序关键

程序&#xff1a; 4.c&#xff1a; #include<stdio.h> void exploit() {system("/bin/sh"); } void main() {char buf[20];gets(buf); }编译&#xff1a; gcc -no-pie -fno-stack-protector -m64 -o 4.exe 4.cNX保护&#xff0c;栈数据不可执行 使用命令&…

fcfs调度算法_FCFS:先来先服务调度算法

fcfs调度算法The FCFS, which stands for First Come First Serve Scheduling Algorithm, is a non-preemptive scheduling algorithm, which means that if a process once starts executing in the processor, then it cannot be preempted in between the processing. Thus,…

nhibernate学习之三级联(Ternary Associations)篇

1) 学习目标通过进一步学习Nhibernate基础知识&#xff0c;掌握用Nhiberate实现对级联的支持&#xff0c;通过一个简单的用户角色权限系统来体验nhibernate对级联的强大支持。2&#xff09;开发环境和必要准备 开发环境为:windows 2003,Visual studio .Net 2005,Sql server 200…

【竞赛题解】Codeforces Round #715 (Div. 2) C

C. The Sports Festival 题意&#xff1a;对于给定的整型数组aaa&#xff0c;每次选择其中一个元素aia_iai​&#xff08;不能重复选择同一元素&#xff09;&#xff0c;每次计算已选择的元素的极差&#xff08;最大元素减最小元素的差&#xff09;&#xff0c;输出最后极差和…

C和汇编---sizeof运算符和strlen函数

sizeof sizeof是C语言的内置运算符&#xff0c;以字节为单位给出指定类型的大小。 程序&#xff1a; #include <stdio.h>int main(void) {int a8;int b sizeof(a);//printf("a占用字节%u\n",sizeof(a));printf("a占用字节%d\n",b);return 0; }反汇…

[原]Asp.net替换不同版本的Dll文件碰到的问题以及解决办法.

情景还原: 今天一个朋友说网站不能上传图片,我检查后发现一直卡住在上传页面,一直滚动,是个Fckeditor控件2.6.3的. 经过google以后得到的结论是图片上传成功,但是没有返回结果,在服务器上可以看到上传的图片. 说明是上传控件有问题,程序不能返回结果. 再google以后发现有人已经…

【桶】220.存在重复元素 III 【LeetCode】

220.存在重复元素 III 【LeetCode】 给你一个整数数组 nums 和两个整数 k 和 t。请你判断是否存在 两个不同下标i和j&#xff0c;使得 abs(nums[i] - nums[j]) < t&#xff0c;同时又满足 abs(i - j) < k。 如果存在则返回 true&#xff0c;不存在返回 false。 示例 1…

远控免杀专题12--Green-Hat-Suite免杀

0x01 免杀能力一览表 几点说明&#xff1a; 1、上表中标识 √ 说明相应杀毒软件未检测出病毒&#xff0c;也就是代表了Bypass。 2、为了更好的对比效果&#xff0c;大部分测试payload均使用msf的windows/meterperter/reverse_tcp模块生成。 3、由于本机测试时只是安装了360全…

远控免杀专题 13----zirikatu免杀

0x01 免杀能力一览表 几点说明&#xff1a; 1、上表中标识 √ 说明相应杀毒软件未检测出病毒&#xff0c;也就是代表了Bypass。 2、为了更好的对比效果&#xff0c;大部分测试payload均使用msf的windows/meterperter/reverse_tcp模块生成。 3、由于本机测试时只是安装了360全…

UML 的九种模型图

1. UML的模型图 UML 的模型图能够将被建模的系统的某一个方面的某一部分以图形的方式表示出来&#xff0c;不同的视图通过将多个不同的模型图有机组合在一起就能够描述系统模型的某方面的特征。UML的模型图是有模型元素构成的&#xff0c;模型元素以图标的形式直观形象的表达…

【莫队】区间众数(Codeforces Round #716 (Div. 2) D)

D. Cut and Stick &#xff08;赛后补题&#xff09;借本题学习莫队算法以及区间众数的求法 题意&#xff1a;对于整型数组&#xff0c;每次询问[L,R][L,R][L,R]区间问最少分为多少个子序列&#xff0c;使得每个子序列的众数xxx的个数cntxcnt_xcntx​不大于 ⌈len2⌉\left \l…

如何正确使用SqlConnection

以前曾见过有人这样写代码&#xff1a; public class Service1 : IService1{private SqlConnection conn new SqlConnection();public void Method1(){//do something with conn;}public void Method2(){//do something with conn;}public void Method3(){//do something with…

远控免杀专题 14 ---AVIator

0x01 免杀能力一览表 几点说明&#xff1a; 1、上表中标识 √ 说明相应杀毒软件未检测出病毒&#xff0c;也就是代表了Bypass。 2、为了更好的对比效果&#xff0c;大部分测试payload均使用msf的windows/meterperter/reverse_tcp模块生成。 3、由于本机测试时只是安装了360全…

【Web开发】级联查询(Ajax/ jQuery/ Servlet)

实现级联查询 共有两个下拉框&#xff0c;第一级为学院&#xff0c;第二级为学院开设的科目。 实现的功能为&#xff1a;当改变学院的选择&#xff0c;第二级下拉框需变为对应学院开设的科目内容。 结果预览&#xff1a; jsp页面 <% page contentType"text/html;…

远控免杀专题(15)-DKMC免杀

0x01 免杀能力一览表 几点说明&#xff1a; 1、上表中标识 √ 说明相应杀毒软件未检测出病毒&#xff0c;也就是代表了Bypass。 2、为了更好的对比效果&#xff0c;大部分测试payload均使用msf的windows/meterperter/reverse_tcp模块生成。 3、由于本机测试时只是安装了360全…

SQL——以面向集合的思维方式来思考

本文来自&#xff1a;http://www.ituring.com.cn/article/details/472 为了以有趣的方式更好地帮助你形成面向集合的思维方式&#xff0c;我将给出自己最喜欢的游戏之一——集合。你可以在线玩这个游戏&#xff0c;网址是www.setgame.com/puzzle/set.htm&#xff0c;每天都会贴…

远控免杀专题(16)-Unicorn免杀

0x01 免杀能力一览表 几点说明&#xff1a; 1、上表中标识 √ 说明相应杀毒软件未检测出病毒&#xff0c;也就是代表了Bypass。 2、为了更好的对比效果&#xff0c;大部分测试payload均使用msf的windows/meterperter/reverse_tcp模块生成。 3、由于本机测试时只是安装了360全…

【汇编语言】乘法(MUL/IMUL)

乘法&#xff08;MUL/IMUL&#xff09; 目录乘法&#xff08;MUL/IMUL&#xff09;IMUL(signed multiply)有符号数乘法MUL(unsigned multiply)无符号数乘法麻&#xff01;属实是被这个有符号乘法给整麻了&#xff0c;教材就一行例子直接不解释了&#xff0c;关于标志位溢出的一…