操作系统 系统开销比率_操作系统中的最高响应比率下一个(HRRN)调度

操作系统 系统开销比率

操作系统中的HRRN调度是什么? (What is HRRN Scheduling in Operating System?)

  • HRRN is the abbreviation of Highest Response Ratio Next Scheduling. It is an optimal scheduling algorithm.

    HRRN是最高响应率下一个调度的缩写 。 这是一种最佳的调度算法。

  • It is non-preemptive scheduling algorithm that means if there is any process currently executing with the CPU and if a new process arrives in the memory and its burst time is smaller than the currently running process then currently running process will not be put in the ready queue and it can complete its execution without any interruption.

    这是一种非抢占式调度算法,这意味着如果CPU当前正在执行任何进程,并且如果有新进程到达内存,并且其突发时间小于当前正在运行的进程,那么当前正在运行的进程将不会处于就绪状态队列,它可以完成其执行而不会受到任何干扰。

  • Non-preemptive scheduling algorithms are designed so that once a process starts its execution, it cannot be preempted until it completes its allotted time.

    非抢占式调度算法的设计宗旨是,一旦一个进程开始执行,就无法抢占该进程,直到它完成其分配的时间。

  • It is the modification of shortest job next (SJN) to mitigate the problem of process starvation.

    这是最短作业下一个(SJN)的修改,以减轻过程不足的问题。

  • In this scheduling algorithm assign the CPU to the next process which has the highest response ratio not according to the shortest burst time.

    在此调度算法中,不根据最短的突发时间将CPU分配给响应率最高的下一个进程。

算法 (Algorithm)

  • This scheduling is done based on the response ratio. Response ratio can be calculated with arrival time, waiting time and CPU burst time.

    该调度是基于响应率来完成的。 响应率可以通过到达时间,等待时间和CPU突发时间来计算。

        Response Ratio = (W+S)/S  Where, W= waiting timeS= Burst time 
    
  • In this scheduling, once a process selected for execution then it will run until its completion.

    在此调度中,一旦选择要执行的进程,它将一直运行到完成为止。

  • First, we have to calculate the waiting time for all the processes. The sum of the periods spent waiting in the ready queue is referred to as waiting time.

    首先,我们必须计算所有流程的等待时间。 在就绪队列中等待所花费的时间之和称为等待时间。

  • Each time processes get scheduled for execution to find response ratio for each available process.

    每次安排执行进程的时间,以查找每个可用进程的响应率。

  • Process having shortest response ratio will be executed first by the processor.

    响应率最短的处理将首先由处理器执行。

  • If two processes have the same response ratio then break the tie using the FCFS scheduling algorithm.

    如果两个进程的响应率相同,则使用FCFS调度算法打破平局。

Example:

例:

Here is an example of HRRN Scheduling given arrival time and burst or service time of each process,

这是给定每个进程的到达时间和突发或服务时间的HRRN调度示例

HRRN Scheduling in OS

Solution:

解:

HRRN Scheduling in OS

Explanation:

说明:

  • At time t = 0, only the process P0 is available in the ready queue. So, process P0 executes till its completion.

    在时间t = 0时,就绪队列中只有进程P0可用。 因此,过程P0一直执行到完成为止。

  • At time t = 4, only the process P1 and P2 are available in the ready queue. So, we have to calculate the response ratio.

    在时间t = 4时,就绪队列中仅进程P1和P2可用。 因此,我们必须计算响应率。

  • The process which has the highest response ratio will be executed next.

    接下来将执行响应率最高的过程。

  • Response Ratio are,

    回应率是

        RR (P1) = [(4 - 3) + 3] / 3 = 1.40RR (P2) = [(4 - 3) + 3] / 3 = 0.75
    
  • Process P1 has highest response ratio so it will selected for execution.

    进程P1的响应率最高,因此将选择执行。

  • After the completion of execution of process P1, there are three processes P2, P3 and P4 are in the ready queue.

    在完成过程P1的执行之后,就绪队列中有三个过程P2,P3和P4。

  • So, the Response Ratio for processes P2, P3 and P4 are,

    因此,过程P2,P3和P4的响应率是

        RR (P2) = [(9 - 4) + 3] / 3 = 2.66RR (P3) = [(9 - 6) + 6] / 6 = 1.50RR (P4) = [(9 - 8) + 3] / 3 = 1.33
    
  • Process P2 has highest response ratio so it will selected for execution.

    进程P2的响应率最高,因此将选择执行。

  • After the completion of execution of process P2, there are three processes P3 and P4 are in the ready queue.

    在完成过程P2的执行之后,在准备队列中有三个过程P3和P4。

  • So, the Response Ratio for processes P3 and P4 are,

    因此,过程P3和P4的响应率是

        RR (P3) = [(12 - 6) + 6] / 6 = 2RR (P4) = [(12 - 8) + 3] / 3 = 2.33
    
  • Process P4 has highest response ratio so it will be executed next.

    进程P4的响应率最高,因此将在下一步执行。

  • After the completion of the execution of process P4, there are only process P3 in the ready queue. So, it will be executed next.

    在完成过程P4的执行之后,就绪队列中只有过程P3。 因此,将在下一个执行。

Advantages

优点

  • Its performance is better than SJF Scheduling.

    它的性能优于SJF计划 。

  • It limits the waiting time of longer jobs and also supports shorter jobs.

    它限制了较长工作的等待时间,也支持较短的工作。

Disadvantages

缺点

  • It can't be implemented practically.

    它实际上无法实现。

  • This is because the burst time of all the processes can not be known in advance.

    这是因为无法预先知道所有进程的突发时间。

翻译自: https://www.includehelp.com/operating-systems/highest-response-ratio-next-hrrn-scheduling.aspx

操作系统 系统开销比率

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

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

相关文章

利用堆栈做循环

程序: #include "stdio.h" int main(int argc,char *argv[]) {char *str"%d";printf("hello world");__asm{ log:lea eax,logpush eaxlea ebx,strpush ebxpush eaxcall printfret 8}return 0;}运行:一直死循环运行下去 …

c# 多线程异步demo

一个 c# winform 多线程异步demo,分享下。 因为例子都很简单,所以不多说明,自己下载吧。转载于:https://www.cnblogs.com/chaobao/archive/2011/08/18/CSharpSync.html

(转)项目管理知识体系术语 123

项目管理知识体系术语(一)本词汇集包括和不包括的术语这个词汇集包括的词汇是:对于项目管理是唯一的,或接近于唯一的词汇(例如:范围说明,工作单元,工作分解结构,关键线路法)。对于项目管理是不是唯一的&…

矩形的个数

描述 在一个3*2的矩形中,可以找到6个1*1的矩形,4个2*1的矩形3个1*2的矩形,2个2*2的矩形,2个3*1的矩形和1个3*2的矩形,总共18个矩形。 给出A,B,计算可以从中找到多少个矩形。 输入 本题有多组输入数据&a…

计算机编程要哪方面天赋,编程要哪门子天赋

开局一张图写代码真的需要天赋吗?有句话是这样说的:论大家的努力程度,远不到拼天赋的时候。我认为所谓的天赋,应该是行业内Top10%水平才需要天赋,比如Linux缔造者Linus Torvalds,苹果发明者斯蒂夫沃兹尼亚克…

VBA之EXCEL删除和设置单元格行高等

‘删除Sheet1上的单元格区域A1:D10,并将其余单元格左移以填补被删除单元格的位置 Sheet1.Range(“A1:D10”).Delete Shift:xlShiftToLeft ‘删除指定行 Range(“1:1”).Delete ‘删除指定列 Columns(5).Delete ‘删除当前行 ActiveCell.EntireRow.Delete ‘删除工作表中的重复行…

java void方法_Java对象类的最终void wait(long ms)方法,包含示例

java void方法对象类最终无效等待(长毫秒) (Object Class final void wait(long ms)) This method is available in java.lang.Object.wait(long ms). 此方法在java.lang.Object.wait(long ms)中可用。 This method causes the current thread to wait for a specified amount …

C和汇编----字符串

字符串是以空字符(\0)结尾的char类型数组。 0x01 定义字符串和初始化 用双引号括起来的内容称为字符串字面量,也叫字符串常量,双引号中的字符串和编译器自动加入\0字符,都作为字符串存储在内存中 #include "st…

出现此版本的sql server不支持用户实例登陆标志 问题的解决方法

场景: 开发工具vs2005 数据库 sql 2005加入了Enterprise Libraty后,新增了一个data access application block,在写ConnectString的时候,出现这个错误提示,解决办法:在连接属性的设置里边,点高级,将User Instance 设置为false,默认的true,所以才导致这个问题的出现.设置好后,重…

计算机编程输入与输出,计算机编程语言的发展与输入输出设备的使用

计算机编程语言的发展与输入输出设备的使用辽宁大学学报自然科学版第32卷 第2期 2005年JOURNALOFLIAONINGUNIVERSITYNaturalSciencesEditionVol.32 No.2 2005计算机编程语言的发展与输入输出设备的使用宋明杰3(辽宁大学信息科学与技术学院,辽宁沈阳110036)摘 要:在编程中涉…

大小写互换

描述 现在给出了一个只包含大小写字母的字符串&#xff0c;不含空格和换行&#xff0c;要求把其中的大写换成小写&#xff0c;小写换成大写&#xff0c;然后输出互换后的字符串。 输入 第一行只有一个整数m&#xff08;m<10),表示测试数据组数。 接下来的m行&#xff0c…

远控免杀专题1---基础篇

0x01 免杀概念 免杀&#xff0c;也就是反病毒与反间谍的对立面&#xff0c;英文为Anti-AntiVirus&#xff08;简写 Virus AV&#xff09;&#xff0c;逐字翻译就是反-反病毒&#xff0c;翻译为反病毒技术。 0x02 杀毒软件检测方法 1、扫描结束 扫描压缩包技术&#xff1a;即…

查询所有存储过程

--查询所有存储过程selectPr_Name as[存储过程], [参数]stuff((select&#xff0c;[Parameter]from( selectPr.Name asPr_Name,parameter.name Type.Name (convert(varchar(32),parameter.max_length))asParameter fromsys.procedures Pr leftjoinsys.parameters…

使用JavaScript中的示例编号MAX_VALUE属性

数字MAX_VALUE属性 (Number MAX_VALUE Property) MAX_VALUE Property is a Number property in JavaScript and it is used to get the maximum value of a number that is possible in JavaScript. MAX_VALUE属性是JavaScript中的Number属性&#xff0c;用于获取JavaScript中可…

文件复制器

文件复制器 2007.08.18.0地狱门神(F.R.C.)http://files.cnblogs.com/Rex/FileCopier.rar 本软件用于复制或更新一个文件夹中的文件到另一个文件夹中。 当你需要经常通过向移动硬盘复制文件来备份重要数据时&#xff0c;可能会遇到如下情况&#xff1a;(1)电脑USB接口过旧&#…

远控免杀专题2---msfvenom的隐藏参数

0x01 msfvenom简介 msfvenom是msfpayload和msfencode的结合体&#xff0c;与2015年6月8日取代了msfpayload和msfencode。在此之后&#xff0c;metasploit-framwork下面的msfpayload&#xff08;载荷生成器&#xff09;&#xff0c;msfencoder&#xff08;编码器&#xff09;&a…

转载CSDN - 从程序员到HR——面试经验分享

CSDN博客一周热文推荐&#xff0c;为您总结回顾过去一周的CSDN博客热门文章&#xff0c;推荐优质的博客作者&#xff0c;分享精华文章和优质博客。 [1] 谭海燕&#xff1a;北漂之惠普H3C面试经历 上一篇讲到了《北漂之百度面试》&#xff0c;今天跟大家分享我在H3C的面试经历。…

ai系统架构_人工智能中的模糊逻辑系统架构

ai系统架构The Fuzzy Logic System is a system which uses Fuzzy logic for reasoning. Fuzzy Logic is a very efficient method for performing human-like reasoning in conditions with uncertainty. 模糊逻辑系统是使用模糊逻辑进行推理的系统。 模糊逻辑是一种在不确定条…

魔力宝贝 服务器状态,魔力宝贝服务端standenemy的参数

格式&#xff1a;encount A|B|C|D|E|F|G|H|I|J|K|L|M|N|O|P|Q|R|S|A是触发战斗类型&#xff0c;这个参数主要用在StandEnemy的NPC参数里面&#xff0c;EventNPC脚本触发战斗有局限。这里详细解释下&#xff1a;触发战斗有2种方法&#xff1a;一种走着撞上去&#xff0c;一种站在…

Firefox中国即将成立,希望在华推行Web标准

Mozilla的首席技术官(vp engineering)Mike Schroepfer给Firefox的粉丝们带来一个好消息:Firefox在中国的负责人李宫昨日接到总部正式通知,将在中国成立公司.Mike称:“公司将设立在清华科技园,在Google、微软的旁边,不过一开始规模不会大,只有几个人.李宫将负责招兵买马.实际上,…