简体   繁体   中英

Linux kernel scheduling

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

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.

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 :)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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