Introduction to Process Scheduling














































Introduction to Process Scheduling



Multi-programming:

In a multi-programming system, multiple process exists concurrently in the main memory. Each process alternates between using a processor and waiting for some event to occur, such as completion of an input/output operation. The processor or processors are kept busy while executing one process, while the others wait. The key to multi-programming is scheduling.


Process Scheduling:

When the process enters into the system, they are put by system in the queue called job queue. All the process in the system reside in the job queue. When the processes are ready for execution and wait for CPU, they are placed in ready queue. The operating system also has other queues. When process wait for particular device, they are kept in respective device queueAfter allocation of CPU to a process, the process starts its execution. While executing a process, one of the number of events could occur. Until the process finishes its execution, it travels between various scheduling queues. The operating system selects the processes from queries based on various scheduling

algorithmsThis selection is carried out by the program called as scheduler.




There are three types of scheduler:


1.     Long Term Scheduler: When programs are submitted to the system for the purpose of processing, long term scheduler comes to know about it. The scheduler's job is to choose process from the queue and place it in the main memory for execution purpose. The primary responsibility of the long-term scheduler is to supply reasonable mix of jobs, such as I/O bound and CPU bound. It also controls the degree of multi-programming.


2.  Short Term Scheduler: Processes which are in ready queue wait for CPU. A short-term scheduler chooses the process from ready queue and assigns it to CPU based on various scheduling algorithms.


3.  Medium Term Scheduler: If the degree of multi-programming increases, the medium-term scheduler swaps out the process from the main memory. The swapped out processes are again swapped in by medium term scheduler.


Comparison of Three Schedulers:                                                                                                     



Sr. No.



Long Term
Scheduler



Short
Term Scheduler



Medium
Term Scheduler



1.



It is a Job Scheduler.



It is a CPU Scheduler.



It is a Process Swapping Scheduler.



2.



It selects the process from the queue and loads them into main memory for execution.



It selects the process from ready queue and assigns it to CPU.



It swaps the processes in and out from the main memory.



3.



Speed is lesser than short term scheduler.



Speed is fastest among the other two.



Speed is in between short and long term scheduler.



4.



Transition of process state from New to Ready.



Transition of process state from Ready to Executing.



No process state transition.



5.



It controls the degree of

multi-programming.



It provides lesser control over degree of multi-programming.



It reduces the degree of multi-programming.



6.



It is almost absent or minimal in time sharing systems.



It is also minimal in time sharing systems.



It is a part of time sharing systems.







Comments

  • Dilkhush
    28-Sep-2019 09:39:40 PM
    Great Job Aashay