sjf调度算法_如何通过静态方法预测SJF调度中未来过程的突发时间?

本文介绍了在SJF调度中如何通过静态方法预测进程的突发时间,包括根据进程类型和根据进程大小两种预测方法。对于不同类型(如用户进程、交互进程、后台进程和操作系统进程)的进程,预测依据不同;而根据进程大小,可通过比较新到达进程与当前运行进程的大小来估算突发时间。
摘要由CSDN通过智能技术生成

sjf调度算法

In SJF Scheduling, CPU is assigned to the process having the smallest burst time but it can not be implemented practically, because we don't know burst time of the arrived processes in advance.

SJF Scheduling中 ,将CPU分配给具有最短突发时间的进程,但是由于我们事先不知道到达进程的突发时间,因此它实际上无法实现。

The predicted burst time of the future process may not always be correct because the burst time of a process also depends on the kind of a process.

未来过程的预测突发时间可能并不总是正确的,因为一个过程的突发时间还取决于一个过程的类型。

There are many methods by which we can predict the burst time for the processes,

我们可以通过多种方法来预测过程的爆发时间

  1. Static methods

    静态方法

  2. Dynamic methods

    动态方法

predict the burst time 1

1)静态方法 (1) Static methods)

There are two static factors by we can predict the burst time of processes,

我们可以通过两个静态因素来预测进程的爆发时间,

  1. According to process type

    根据Craft.io类型

  2. According to process size

    根据Craft.io尺寸

predict the burst time 2

i)根据Craft.io类型 (i) According to process type)

In this method, burst time can be predicted according to the type of process,

在这种方法中,可以根据进程类型预测突发时间,

User Process:

用户流程

The Process which is initiated by the users is referred to as user processes. User processes can be of the following types.

由用户发起的过程称为用户过程。 用户进程可以是以下类型。

Foreground process:

前台流程

The processes which are accessed by the user to perform their needs such as MS office, Editors, utility software, calculators, etc are called foreground processes.

用户访问以执行其需求的过程,例如MS Office,编辑器,实用软件,计算器等,称为前台过程。

These types of processes are a perfect mix of CPU and IO bound processes so they have a bit higher burst time.

这些类型的进程是CPU和IO绑定进程的完美结合,因此它们的突发时间要长一些。

Interactive Process:

互动过程

The processes which interact with the user at different time intervals or execution of these processes totally depends on the user inputs are called Interactive Processes. Various games have come in the category of interactive processes.

在不同时间间隔与用户交互的过程或这些过程的执行完全取决于用户的输入,称为交互过程。 各种游戏都属于交互过程类别。

They don't need a processor for a large amount of time. As a result, the burst time of these processes is low. They are mainly IO bound processes because they mainly depend upon the user's interactivity with the process

他们不需要大量时间的处理器。 结果,这些过程的突发时间很短。 它们主要是受IO约束的流程,因为它们主要取决于用户与流程的交互性

Background process:

后台进程

Some processes support the execution of other processes are known as background processes. These processes work in hidden mode. Just like, the key logger is the process that records the keys pressed by the user and activities of the user on the system. These processes need CPU for a large amount of time that’s why they are CPU bound processes.

一些支持其他进程执行的进程称为后台进程。 这些进程以隐藏模式工作。 就像键记录器一样,它是记录用户按下的键和用户在系统上的活动的过程。 这些进程需要大量的CPU时间,这就是它们是受CPU约束的进程的原因。

Operating System Process:

操作系统流程

Operating System Processes can be of different types such as schedulers, compilers, program managers and many more other system processes. Burst time of Operating system process is generally lower approximate 3 to 5 units of time.

操作系统进程可以是不同类型的,例如调度程序,编译器,程序管理器以及更多其他系统进程。 操作系统进程的突发时间通常较低,大约为3到5个单位时间。

ii)根据Craft.io规模 (ii) According to process size)

In this method, burst time can be predicted according to the size of a process.

在这种方法中,可以根据过程的大小预测突发时间。

Here, the burst time is taken similar to the currently running process and the newly arrived process that is to be executed.

在此,突发时间类似于当前正在运行的进程以及将要执行的新到达进程。

For example, suppose a size currently running process (Pold) is 150 KB and it takes 10 units of time for its execution.

例如,假设当前正在运行的进程(Pold)大小为150 KB,并且执行该进程需要10个时间单位。

So, the burst time for any newly arrived process of size around 150 KB can be taken as 10 units of time.

因此,任何大小约为150 KB的新到达进程的突发时间都可以视为10个时间单位。

References:

参考文献:

翻译自: https://www.includehelp.com/operating-systems/how-can-be-predict-the-burst-time-of-future-process-in-sjf-scheduling-by-static-method.aspx

sjf调度算法

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值