Linux内核调度

发布于 2024-08-24 08:17:13 字数 44 浏览 2 评论 0原文

我想知道旧的Linux调度算法SJF(最短作业优先)如何计算进程运行时间?

I wish to know how Old Linux scheduling algorithm SJF (shortest job first) calculates the process runtime ?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

陈独秀 2024-08-31 08:17:13

这个问题实际上是它很少在常见环境中使用的主要原因之一,因为SJF算法需要准确估计所有进程的运行时间,而这只有在专门的环境中才会给出。

通常情况下,你只能得到估计的、不准确的进程运行时间长度,例如,通过记录同一进程之前CPU突发的长度,并使用数学近似的方法来计算下一次运行的时间。

This problem actually is one of the major reasons why it is rarely used in common environments, since SJF algorithm requires accurate estimate of the runtime of all processes, which is only given in specialized environments.

In common situations you can only get estimated and inaccurate length of process running time, for example, by recording the length of previous CPU bursts of the same process, and use mathematical approximation methods to calculate how long it will run next time.

嘿哥们儿 2024-08-31 08:17:13

如果您有一些带宽需要消耗,您可能能够找到实际的代码此处。从 2.0 开始,我认为您会发现它是实验性的。

SJF (IIRC) 极其短暂存在,原因正是 ZelluX注意到

我认为此时您了解其疯狂背后的方法的唯一希望就在于代码中。您也许能够构建它并使其在模拟器中启动。

编辑:

我现在不完全确定它是否确实进入了主线。如果你找不到,别怪我:)

If you have some bandwidth to burn, you might be able to find the actual code here. Start at 2.0, where I think you'll find it as experimental.

SJF was (IIRC) extremely short lived, for the exact reasons that ZelluX noted.

I think your only hope to understand the method behind its madness lives in the code at this point. You may be able to build it and get it to boot in a simulator.

Edit:

I'm now not completely sure if it ever did go into mainline. If you can't find it, don't blame me :)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文