Subscribe to our RSS Feeds

Types of CPU schedulers

0 Comments »

Several types of schedulers may be used in operating systems there are three fundamental types of schedulers

·         Long term scheduler
·         Short term scheduler
·         Medium term scheduler

Long term scheduler

Long term scheduler is also known as job scheduler. It selects jobs or user programs from job poolon the disk and loads them into main memory. Once a job or user program is loaded into memory, it becomes the process and added to the ready queue.  The long term scheduler controls the number of process in memory. It means that it controls the degree of multiprogramming.

Short term scheduler

The short term scheduler is also known as dispatcher. It retrieves a process from the ready queue and CPU is allocated to it. The process state is changed from ready to running. If an interrupt or time out occurs the scheduler places the running process back into the ready queue and marks it as ready. Typically the dispatcher gives the control of CPU for a fixed amount of time. A Process may execute for only a few milliseconds, and then the next process is selected form ready queue for execution and so on. The time taken by the dispatcher to stop the execution of one process and then to start the execution of another process is known as the dispatcher latency.

Medium term scheduler

The medium term scheduling is also known as swapping. In this scheduling swapper is used to exchange process between main memory and secondary storage (disk). Typically multiprocessing system use swapping technique, Sometimes a process that  is in job queue on disk is too long and cannot be fit in memory, then swapper removes another process from ready queue to make room for it. Later the same process is re-loaded into memory, which is added to ready queue and its execution is continued where it left off if a process is waiting for completion of a short term I/O operation than it is not swapped out.
4:54 PM