CPU scheduling is a relatively simple idea which is important; because in a single processor system; the process must wait before being executed for the completion; of some I/O request resulting in the waste or loss of processor time as it left idle. This problem is solved using CPU scheduling; as the CPU keeps multiple processes in memory at a time; when a process has to wait until the CPU; is allocated to another process that is ready to execute by the operating system; making it a multiprogramming environment. Once a process has to wait the CPU is taken over by another process and this continues.
The CPU is totally dependent; on the property of the process that is executed or waits. The process starts with CPU burst followed by I/O burst; then again followed by CPU burst which a request for terminate execution. Once the process is in wait the operating system selects one process in the ready queue and allocates the CPU to it. The schedulers that co-exist in a complex operating system caught up in a “multitasking system”, with each deciphering scheduling trouble for each region of operating system functionality; the “long-term scheduler”, “mid-term scheduler”, and “short-term scheduler”.
Long-Term Scheduler:
The long scheduler also known as the admission scheduler decides which process should be brought o the ready queue; moreover during the attempt of a process execution the long scheduler decides whether to admit or delay it. The “long term” scheduling; is carried out at the start when the new process is formed. The responsibility of the scheduler is to decide whether the process should be added; from “NEW state queue” to “READY state queue” and supervise the number of processes in the “READY state” queue; as if the number of processes in the ready state is higher than in the ready queue, it became impossible for the OS or processor to preserve “long lists”; “context switching and dispatching increases”. So it permits only an inadequate or limited amount or quantity of processes into the ready queue.
Medium-Term Scheduler:
This type of scheduler is a component of the swapping function; that is the transfer of data from memory to processor as the main memory frees OS; checks the list of suspended processes and decides which one should be swapped in; or transferred to on the basis of property; memory and resources required. It basically performs the swapping in or transfers function among the exchanged processes.
Short-Term Scheduler:
“CPU scheduler” or “Short term Scheduler”; is called or invoked every time an event is raised; that may escort to interruption or disturbance of the recent process in execution. Moreover, its duty is to find a process in the ready state and allocates the CPU to it. Making scheduling decisions is less common and frequent for the long-term and mid-term schedulers than the short-term scheduler. The short-term scheduler can be either “preemptive” (blocking) or “non-preemptive” (non-blocking). A preemptive scheduler forces any process to exit the CPU when it decides to assign another process to the CPU. A non-preemptive scheduler cannot force or oblige any process to exit the Central Processing Unit.