fcfs调度_具有开销的FCFS调度

fcfs调度

In the FCFS scheduling, we consider that all the processes or jobs are the CPU bound jobs (if any process spends most of its time simply using the CPU or doing calculations, so this process is called CPU bound process) only. We do not think about the context switching time.

FCFS调度中 ,我们认为所有进程或作业都是受CPU约束的作业(如果任何进程花费大部分时间只是使用CPU或进行计算,因此该进程称为受CPU约束的进程)。 我们不考虑上下文切换时间

A procedure in which a processor (central processing unit) follows to change from one task (or job) to another while ensuring that the tasks do not conflict by the context or state of a process so that it can be reloaded when required and execution can be resumed from the same point as earlier, this is called Context Switching.

一种过程,在该过程中,处理器(中央处理单元)从一个任务(或作业)更改为另一个任务,同时确保任务不会因进程的上下文或状态而冲突,以便可以在需要时重新加载它,并可以执行从先前的相同点恢复,这称为上下文切换

The average waiting time of the system will be increased If we consider the time taken by the scheduler in context switching. This condition also affects the efficiency of the system. It is always overhead in scheduling.

如果我们考虑调度程序在上下文切换中花费的时间,则系统的平均等待时间将增加。 这种情况也会影响系统的效率。 调度总是开销。

If we consider the context switching time in the system, so the efficiency will be affected. We can describe it with the following example.

如果我们考虑系统中的上下文切换时间 ,那么效率将受到影响。 我们可以通过以下示例对其进行描述。

Here, we are considering six processes with process id as P1, P2, P3, P4, P5, and P6. The arrival time and Burst time of these processes are as under,

在这里,我们考虑六个进程ID为P1P2P3P4P5P6的进程。 这些过程的到达时间和爆发时间如下,

Process IdArrival timeBurst time
P002
P113
P222
P335
P446
P554
流程编号 到达时间 爆发时间
P0 0 2
P1 1个 3
P2 2 2
P3 3 5
P4 4 6
P5 5 4

We denote the context switching time by δ sign and let's take δ=1 unit; Then the Gantt chart of the system will be prepared as follows:

我们用δ符号表示上下文切换时间,δ= 1单位 ; 然后,将按以下方式准备系统的甘特图:

FCFS with Overhead


Gantt Chart

甘特图

By this overhead, the system will take an extra 1 unit of time after the execution of every process or task to schedule the next task.

通过这种开销,系统将在执行每个进程或任务之后花费额外的1个时间单位来安排下一个任务。

Useless time / Wasted time          = 6 * δ = 6 * 1 = 6 unit
Total time taken by all processes   = 28 unit
Useful time of processes            = 28 unit – 6 unit = 22 unit
 
Efficiency (η) of system    = Useful time  / Total time
                            = 22 unit / 28 unit
                            = 0.7857
                            = 78.57 %

Inefficiency    = Wasted time / Total time
                = (6 / 28 * 100) %
                = 21.42 %

References:

参考文献:

翻译自: https://www.includehelp.com/operating-systems/fcfs-scheduling-with-overhead.aspx

fcfs调度

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值