Friday, 17 August 2012

Process Scheduling

Process Scheduling

 A process migrated between various scheduling queues throughout its life cycle ,The OS select the process for scheduling from this queue in some order.It depend on the different scheduling algorithm followed by the operating system. The selected process is carried out by the different scheduler.
                                  There are three type of scheduler:
                                                                                    1) Long Term Scheduler
                                                                                    2) Short Term Scheduler
                                                                                    3) Middle term scheduler

Long Term Scheduler:
 The long-term, or admission scheduler, decides which jobs or processes are to be admitted to the ready queue i.e  from secondary memory to main memory.Thus, this scheduler dictates what processes are to run on a system, and the degree of concurrency to be supported at any one time 

Middle term scheduler
The medium-term scheduler temporarily removes processes from main memory and places them on secondary memory. This is commonly referred to as "swapping out" or "swapping in" . This schedular is active during migration from waiting state to ready state and ready state to waiting state . 
                        Short Term Scheduler :
The short term scheduler is responsible for allocation of process waiting at the ready queue to the CPU. Different algorithm are used to select the process depending on various criteria.This scheduler is called very frequently. This scheduler can be preemptive, implying that it is capable of forcibly removing processes from a CPU when it decides to allocate that CPU to another process, or non-preemptive in which case the scheduler is unable to interrupt the process running in the system.
  
                               A very important component involved in the system is called Dispatcher.It is the module that connect the CPU to the process selected by the Short Term Scheduler. There are two primary function of  dispatcher 
   1)Switching
   2)Jumping
Switching means switch the CPU from one process to another. Jumping means jump to the proper location in the user program and ready to start execution.


Different CPU algorithm:
                 1) First come First service (FCFS)
                 2) Shortest Job First (S
                 3) Shortest Remaining Time first (SRTF)
                 4)Priority Scheduling
                 5)Round Robing (RR)
                 6)Multilevel Queue Scheduling
                 7)Multilevel Feedback Queue Scheduling

NOTE  If we go through the algorithms, we will know that there is no special difference between FCFS and RR. If the time quantum of the system is high then the algorithm  act as FCFS. In the case of SJF  and SRTF , SJF may be non preemptive  scheduling but if SJF is preemptive then  the algorithm is called SRTF. Priority scheduling may be preemptive and non preemptive , and to save process starving from priority and multilevel queue scheduling multilevel feedback queue scheduling is implemented
Aging is the way to save a process from starving.



                                                              ..........to be continued                                       R.P









                        

No comments:

Post a Comment