I wish to know how Old Linux scheduling algorithm SJF (shortest job first) calculates the process runtime ?
The Completely Fair Scheduler (CFS) is a process scheduler that was merged into the 2.6. 23 (October 2007) release of the Linux kernel and is the default scheduler of the tasks of the SCHED_NORMAL class (i.e., tasks that have no real-time execution constraints).
Current Linux kernel uses Completely Fair Scheduler(CFS) which does not meet the complete requirements of a good scheduler, since its complexity is O(log n) and its scheduling policy can cause starvation of optimally threaded process in the presence of greedy threaded process.
CFS gives every task a fair share of processor resources in a low-fuss but highly efficient way. Linux takes a modular approach to processor scheduling in that different algorithms can be used to schedule different process types. A scheduling class specifies which scheduling policy applies to which type of process.
Priority based preemptive scheduling algorithm.
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 love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With