简体   繁体   English

CPU如何知道一个进程需要多少时间才能完成?

[英]How does CPU know how much time a process take to complete?

I studying various CPU scheduling algorithm in OS, I was asked this question once I was not able to answer it.我研究了操作系统中的各种 CPU 调度算法,一旦我无法回答,我就被问到这个问题。 Can anyone explain me?谁能解释我?

OS can compute the total needed time for each task, by means of first calculating its CPI (cycles per instruction).操作系统可以通过首先计算其 CPI(每条指令的周期)来计算每个任务所需的总时间。 There is a weighted average CPI for each job.每项工作都有一个加权平均 CPI。 I hope this answers the question.我希望这能回答这个问题。 But if you are talking about burst time then there is a default value to those unknown processes.但是,如果您谈论的是突发时间,那么这些未知进程就有一个默认值。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM