2012-10-13 59 views
1

我正在重新审视操作系统CPU作业调度,突然间一个问题突然出现在我脑海中,操作系统如何知道执行前的进程执行时间,我的意思是在调度算法像SJF(最短作业第一),过程的执行时间如何计算先验?操作系统如何知道进程的执行时间

回答

1

维基百科:

Another disadvantage of using shortest job next is that the total execution time of a job must be known before execution. While it is not possible to perfectly predict execution time, several methods can be used to estimate the execution time for a job, such as a weighted average of previous execution times.[1]

更多关于http://en.wikipedia.org/wiki/Shortest_job_next

+0

哎呀我的坏,我忘了检查维基页面。谢谢。 – Bond

1

另外,O.S可以通过首先计算其CPI装置计算所需要的时间为每个任务的总。

(CPI:每个指令周期)

没有为每个作业的加权平均CPI。例如,浮点指令比定点指令重要得多,这意味着它们需要更多时间来执行。所以处理定点操作的工作:比如增加或增加被认为更短。因此,在最短的工作中,应在上述工作之前执行。

相关问题