操作系统 系统开销比率_操作系统中的最高响应比率下一个(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

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

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

C和汇编----字符串

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

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

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

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

CSDN博客一周热文推荐,为您总结回顾过去一周的CSDN博客热门文章,推荐优质的博客作者,分享精华文章和优质博客。 [1] 谭海燕:北漂之惠普H3C面试经历 上一篇讲到了《北漂之百度面试》,今天跟大家分享我在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. 模糊逻辑系统是使用模糊逻辑进行推理的系统。 模糊逻辑是一种在不确定条…

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

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

远控免杀专题3---msf自免杀

0x01 免杀能力一览表 上面表中标识 √ 说明相应杀毒软件未检测出病毒,也就是代表了Bypass。为了更好的对比效果,大部分测试payload均使用msf的windows/meterperter/reverse_tcp模块生成。由于本机测试时只是安装了360全家桶和火绒,所以默认情…

苹果手机的计算机删除了怎么恢复,苹果手机电话删除了怎么恢复

在清理手机通讯录的时候,万一不小心误删了手机通讯录,怎么办。那么被删除的手机通讯录还能找回吗?答案是可以的,苹果手机通讯录删除了怎么恢复呢。苹果手机电话删除了怎么恢复一、从iCloud恢复步骤1、打开【设置】-【Apple ID】-【iCloud】&…

远控免杀4---Evasion免杀

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

远控免杀5---Veil免杀

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

远控免杀专题6---Venom免杀

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

查看ajax传来的数据,jQuery AJAX 方法 success()后台传来的4种数据

1.后台返回一个页面js代码/**(1)用$("#content-wrapper").html(data);显示页面*/$.ajax({async : false,cache : false,type : POST,url : area/prepareCreate,error : function() {alert(smx失败 );},success : function(data) {$("#content-wrapper").ht…

远控免杀专题7 ---shellter免杀

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

将文件拖到docker容器里,将docke 容器里文件拖到宿主里

docker将/root/shell目录下的putty.exe复制到容器内部: 查看容器ID: docker ps 复制: docker cp /root/shell/putty.exe 容器ID:/root docker将容器内部的/root/shell/payload.exe复制到宿主里: docker cp b8d6b6b6296d:/root…

拜托,出来混有点专业精神好不好

2007年5月25日的安徽日报头版中武警防汛大演练照片如下:很明显的最上面的两艘船是一样的,甚至连激起的浪花都相同,真不知道ps这幅图的同学当时怎么想的,一点专业精神都没有撒~再看看下面的盗版光碟《十面埋妇》的包装&…

远控免杀专题8---BackDoor-Facktory免杀

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

C和汇编----存储类别、链接和内存管理

0x01 存储类别 1、作用域 一个C变量的作用域可以是块作用域、函数作用域、函数原型作用域或文件作用域。 1.1 块作用域: 块是用一对花括号括起来的代码区域。比如函数体就是一个块。定义在块中的变量具有块作用域,块作用域变量的可见范围是从定义处到包…

服务器appcrash的问题怎么修复,ghost win7出现appcrash的问题怎么修复

ghost win7出现appcrash的问题怎么修复一位用户说在win7旗舰版电脑中运行程序会出现appcrash错误的提示,appcrash出错想必很多用户都遇到过,也不知道什么原因引起的,导致程序无法正常运行。那么有什么方法可以解决ghost系统win7运行程序出现a…