操作系统抢占式优先级调度_操作系统中的优先级调度(非抢先)

操作系统抢占式优先级调度

Priority scheduling is a type of scheduling algorithm used by the operating system to schedule the processes for execution. The priority scheduling has both the preemptive mode of scheduling and the non-preemptive mode of scheduling. Here, we will discuss the non-preemptive priority scheduling algorithm.

优先级调度是操作系统用来调度要执行的进程的调度算法。 优先级调度既有抢占式调度又有非抢占式调度。 在这里, 我们将讨论非抢占式优先级调度算法

As the name suggests, the scheduling depends upon the priority of the processes rather than its burst time. So, the processes, in this case, must also have the priority number in its details on the basis of which the OS will schedule it.

顾名思义,调度取决于进程的优先级,而不是突发时间。 因此,在这种情况下,进程还必须在其详细信息中具有优先级号,操作系统将根据该优先级号对其进行调度。

For example, suppose we have 4 processes: P1, P2, P3 and P4 and they enter the CPU as follows:

例如,假设我们有4个进程: P1P2P3P4 ,它们按如下方式进入CPU:

Note: Here, lower the priority number, higher is the priority.

注意:此处,优先级数字越低,优先级越高。

priority scheduling in OS

As per the non-preemptive priority scheduling, the processes will be executed as follows:

根据非抢先优先级调度 ,将按以下方式执行过程:

Gant Chart:

甘特图:

priority scheduling in OS

Explanation:

说明:

  • There is only P1 available at time 0, so it will be executed first irrespective of the priority, and it cannot be preempted in between before its completion.

    在时间0只有P1可用,因此无论优先级如何都将首先执行它,并且在完成之前不能抢占它。

  • When it is completed at 4th-time unit, we have all P2, P3, and P4 available. So, they are executed according to their priorities.

    当以 4 单位完成时,我们将拥有所有P2P3P4 。 因此,将根据优先级执行它们。

priority scheduling in OS
    Total Turn Around Time = 4 + 7 + 9 + 2
= 22 milliseconds
Average Turn Around Time= Total Turn Around Time / Total No. of Processes
= 22 / 4
= 5.5 milliseconds
Total Waiting Time = 0 + 5 + 6 + 0
= 11 milliseconds
Average Waiting Time = Total Waiting Time / Total No. of Processes
= 11 / 4
= 2.75 milliseconds

翻译自: https://www.includehelp.com/operating-systems/priority-scheduling-non-preemptive.aspx

操作系统抢占式优先级调度

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

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

相关文章

MySQL 基础模块的面试题总结

说一下 MySQL 执行一条查询语句的内部执行过程? 客户端先通过连接器连接到 MySQL 服务器。连接器权限验证通过之后,先查询是否有查询缓存,如果有缓存(之前执行过此语句)则直接返回缓存数据,如果没有缓存则进入分析器。分析器会对查询语句进行语法分析和词法分析,判断 SQ…

Oracle 练习作业10.1-1-2

--一、现有学生表student,班级表classInfo,表结构如下:--student表:sid学号,sname姓名,sex性别,birthday生日,age入学年龄,smoney缴费,cid班级ID--classInfo表…

math.sqrt_Math.SQRT1_2属性与JavaScript中的示例

math.sqrtJavaScript | Math.SQRT1_2属性 (JavaScript | Math.SQRT1_2 Property) Math.SQRT1_2 is a property in math library of JavaScript that is used to find the value of square root of . It is generally used to solve problems related to circular figures. Math…

微软职位内部推荐-Principal Group Program Manager

微软近期Open的职位:Standard job title: Principal Group Program ManagerDiscipline: Program ManagementProduct: BingDivision: Online Services DivisionGroup OverviewSearch Technology Center, Asia (STCA) is a world class engineering hub for Microsoft. We have t…

MySQL 事务的面试题总结

事务是什么? 事务是一系列的数据库操作,是数据库应用的基本单位。MySQL 事务主要用于处理操作量大,复杂度高的数据。 事务有哪些特性? 在 MySQL 中只有 InnDB 引擎支持事务,它的四个特性如下: 原子性&a…

数据结构pta选择判断复习

第一章绪论 1-3数据的逻辑结构是指数据的各数据项之间的逻辑关系。 错 是数据元素之间的逻辑关系 2-4以下属于逻辑结构的是( )。 (2分) 顺序表 散列表 有序表 单链表 有序表 2-12以下关于数据结构的说法中正确的是____。 (2分) A数据结构的逻辑结构独立于…

php删除数组中的空元素_PHP | 从数组中删除所有出现的元素

php删除数组中的空元素Given an array and we have to remove all occurrences of an element from it. 给定一个数组,我们必须从中删除所有出现的元素。 array_diff()函数 (array_diff() function) To remove all occurrences of an element or multiple elements…

粗略的看JFinal的基于AOP的拦截器的实现

2019独角兽企业重金招聘Python工程师标准>>> 简单的说一下AOP的实现,所谓AOP,即(Aspect Oriented Programming)的缩写,体现在程序中就是你可以通过配置在任意的代码块前后插入你想插入的执行代码。例如日志…

MySQL 索引的面试题总结

什么是索引? 索引是一种能帮助 MySQL 提高查询效率的数据结构。 索引分别有哪些优点和缺点? 索引的优点如下: 快速访问数据表中的特定信息,提高检索速度。创建唯一性索引,保证数据表中每一行数据的唯一性。加速表与表之间的连接。使用分组和排序进行数据检索时,可以显…

大二上数据结构复习

目录 第一章绪论练习 第二章线性表 第三章栈和队列 第四章串 第五章数组和广义表 第六章树和二叉树 第七章图 第九章查找 第十章排序 第一章绪论练习 1-8 数据结构的抽象操作的定义与具体实现有关。 (1分) T F 1-14 数据结构包括数据对象集以及它们的逻辑结构和物理结构&#…

MD5算法实现

什么是MD5???---MD5的全称是Message-Digest Algorithm 5 MD5的典型应用是对一段信息(Message)产生信息摘要(Message-Digest),以防止被篡改。比如&…

Oracle plsqlI 练习 传值

--根据人名查个人薪水和本部门平均薪水--select语句实现select a.deptno "部门编号",a.dname "部门名称",a.ename "姓名",a.sal "薪水",b.avg_sal "部门平均薪水"from (select d.deptno, d.dname, e.ename, sal n…

Java StringBuilder codePointBefore()方法与示例

StringBuilder类codePointBefore()方法 (StringBuilder Class codePointBefore() method) codePointBefore() method is available in java.lang package. codePointBefore()方法在java.lang包中可用。 codePointBefore() method is used to represent the Unicode code point …

MySQL 中锁的面试题总结

什么是锁?MySQL 中提供了几类锁? 锁是实现数据库并发控制的重要手段,可以保证数据库在多人同时操作时能够正常运行。MySQL 提供了全局锁、行级锁、表级锁。其中 InnoDB 支持表级锁和行级锁,MyISAM 只支持表级锁。 什么是死锁? 是指两个或两个以上的进程在执行过程中,因…

Oracle-(if/case/以及模拟注册登录)练习-20131015

--作业--1、 输入部门编号,按照下列加薪比例执行(用if-elsif 和case两种方法实现)。--deptno raise(%)--10 5%--20 10%--30 15%--40 20%--加薪比例以现有的sal为标准--方法一select deptno,ename,sal,(case deptnowhen 10 then sal * 0…

大二上数据结构复习2

第二章线性表 综合 一、在什么情况下用顺序表比用链表好 表长度确定,很少进行插入删除操作且经常访问元素 二、2-4 顺序表的插入和删除要求仍然保持各个元素原来的次序。设在等概率情形下, 对有 127 个元素的顺序表进行插入, 平均需要移动多少个元素? 删除一个元素…

Java SimpleTimeZone inDaylightTime()方法及示例

SimpleTimeZone类inDaylightTime()方法 (SimpleTimeZone Class inDaylightTime() method) inDaylightTime() method is available in java.util package. inDaylightTime()方法在java.util包中可用。 inDaylightTime() method is used to check whether the given date (d) is …

MySQL 命令和内置函数

如何用命令行方式连接 MySQL 数据库? 使用 mysql -u用户名 -p密码; 输入用户名和密码就可以正常进入数据库连接了,实例如下: mysql -uroot -p123456; 其中,用户名为 root,密码为 123456。 关于命令 mysql -h 127.0.0.1 -uroot -P 3307 -p3307 以下说法错误的是? A.-h …

Oracle plsql 月历

declarev_year number : 2013;v_month number : &input_month;v_day number;v_lastday number;begindbms_output.put_line(v_year || 年 || v_month || 月的月历);--转换星期为数字,方便计算case substr(to_char(to_date(v_year || v_month,yyyymm),day),3,1)wh…

Java GregorianCalendar setTimeZone()方法与示例

GregorianCalendar类setTimeZone()方法 (GregorianCalendar Class setTimeZone() method) setTimeZone() method is available in java.util package. setTimeZone()方法在java.util包中可用。 setTimeZone() method is used to sets the time zone with the specified TimeZon…