In: Computer Science
In Linux, under the CFS ( Completely Fairs Scheduler ) Scheduler, whether a process runs immediately , preempting the currently running process depends upon what factor?
Note: Short Answer Please
In Linux, we can simultaneously execute multiple processes. But only one process can be executed by the processor at one instance of time. Here comes the concept of schedulers. It is that part of the kernel which is responsible for giving access to the CPU by different tasks. The CFS or the Completely Fair Scheduler gives appropriate time to each process with different priorities depending upon their execution time. It uses a O(log n) algorithm. It depends on a tree like data structure. The nodes of the tree are the processes along with their run times as the key. If the run time is small it goes to the left of the tree. The CFS picks the left most node as the next process to be executed. The time for which a process is allowed to execute has a decay factor. The CFS uses priority as that factor. Higher priority processes have lower decay factors and lower priority processes have a higher decay factor.