LJF:最长作业优先调度算法

The LJF, which stands for Longest Job Scheduling Algorithm keeps track of the Burst time of all the available processes at the arrival time itself and then assigns the processor to that process which has the longest burst time. It a type of non-preemptive scheduling algorithm where once a process starts its execution, it cannot be interrupted in between its processing and any other process can be executed only after the assigned process has completed its processing and has been terminated.

LJF代表最长作业调度算法 ,它会在到达时间本身跟踪所有可用进程的突发时间,然后将处理器分配给具有最长突发时间的进程。 它是一种非抢占式调度算法,其中,一旦某个进程开始执行,就无法在其处理之间中断它,并且只有在分配的进程完成其处理并终止之后,才能执行任何其他进程。

The LJF scheduling algorithm is just as the SJF. The only difference is that The SJF scheduling algorithm executes the processes with the shortest burst time first, whereas, in LJF, the processes with the longest burst time are executed first. However, LJF is not considered to be an efficient way of process scheduling because there are many drawbacks of it like the Convoy effect is displayed by it, it has very large average turn-around time and average waiting time. This results in slow processing and decreases the effectiveness of the system.

LJF调度算法SJF一样 。 唯一的区别是SJF调度算法首先执行突发时间最短的进程,而在LJF中 ,首先执行突发时间最长的进程。 但是, LJF不被认为是一种有效的流程调度方式,因为它有很多缺点,例如它显示了Convoy效果,它具有很大的平均周转时间和平均等待时间。 这导致处理缓慢并降低系统的有效性。

Let us explain it with the help of an example to understand it better. Suppose there are four processes with process ID's P1, P2, P3, and P4 and they enter into the CPU as follows:

让我们借助一个示例对其进行解释,以更好地理解它。 假设有四个进程ID为P1P2P3P4 ,它们按如下方式进入CPU:

LJF algorithm

So, if the OS follows the FCFS algorithm for scheduling these processes, then they will be executed in the following manner:

因此,如果操作系统遵循FCFS算法来调度这些进程,则将以以下方式执行它们:

Gant Chart:

甘特图:

LJF algorithm

Explanation: As the processes keep arriving, the one with the largest burst time are executed first. And no process can interrupt in the execution of the other process in between.

说明:随着进程不断到达,将首先执行突发时间最大的进程。 并且没有一个进程可以中断其他进程之间的执行。

LJF algorithm
    Total Turn Around Time = 2 + 11 + 6 + 8
                = 27 milliseconds
    Average Turn Around Time= Total Turn Around Time / Total No. of Processes
                = 27 / 4
                = 6.75 milliseconds

    Total Waiting Time = 0 + 10 + 0 + 5
                = 15 milliseconds
    Average Waiting Time = Total Waiting Time / Total No. of Processes
                = 15 / 4
                = 3.75 milliseconds


翻译自: https://www.includehelp.com/operating-systems/ljf-longest-job-first-scheduling-algorithm.aspx

  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
TypeError: must be str, not list这个错误通常是因为代码中使用了一个列表(list)而不是字符串(str)。根据引用和引用的提示,可以看出在写入文件时出现了这个错误。 在引用的<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* [报错解决TypeError: write() argument must be str, not list](https://blog.csdn.net/ljf520lhy/article/details/127917853)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 33.333333333333336%"] - *2* [Python BeautifulSoup [解决方法] TypeError: list indices must be integers or slices, not str](https://download.csdn.net/download/weixin_38590567/14871394)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 33.333333333333336%"] - *3* [Python_异常:TypeError: write() argument must be str, not list](https://blog.csdn.net/weixin_30691871/article/details/95579470)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 33.333333333333336%"] [ .reference_list ]

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值