Page 92 - DCAP403_Operating System
P. 92

Unit 5: Scheduling




          the time each of them may control CPU for, if a fair share of responsiveness is to be given to all   Notes
          processes. Moreover you have already seen that a too high number of processes causes waste of
          CPU time for system housekeeping chores (trashing in virtual memory systems is a particularly
          nasty example of this). However, the number of active processes should be high enough to keep
          the CPU busy servicing the payload (i.e. the user processes) as much as possible, by ensuring that

          - on average - there always be a sufficient number of processes not waiting for I/O.
          Simple policies for long term scheduling are:
          1.   Simple First Come First Served (FCFS): It’s essentially a FIFO scheme. All job requests
               (e.g. a submission of a batch program, or an user trying to log in in a time shared system)

               are honoured up to a fixed system load limit, further requests being refused tout court, or
               enqueued for later processing.
          2.   Priority schemes: Note that in the context of long term scheduling ``priority’’ has a different
               meaning than in dispatching: here it affects the choice of a program to be entered the system
               as a process, there the choice of which ready process process should be executed.

          Long term scheduling is performed when a new process is created. It is shown in the fi gure
          below. If the number of ready processes in the ready queue becomes very high, then there is a
          overhead on the operating system (i.e., processor) for maintaining long lists, context switching
          and dispatching increases. Therefore, allow only limited number of processes in to the ready
          queue. The “long-term scheduler” managers this. Long-term scheduler determines which
          programs are admitted into the system for processing. Once when admit a process or job, it
          becomes process and is added to the queue for the short-term scheduler. In some systems, a
          newly created process begins in a swapped-out condition, in which case it is added to a queue
          for the medium-term scheduler scheduling manage queues to minimize queueing delay and to
          optimize performance.
                                    Figure 5.8: Long-term Scheduling



                                 New
                     Long-term           Long-term
                     scheduling          scheduling
                                                Short-term
                        Ready                   scheduling
                       suspend           Ready            Running
                                                                  Exit
                              Medium-term
                               scheduling
                                                   Event wait     Terminated
                       Waiting
                       suspend           Waiting


          The long-term scheduler limits the number of processes to allow for processing by taking the
          decision to add one or more new jobs, based on FCFS (First-Come, fi rst-serve) basis or priority
          or execution time or Input/Output requirements. Long-term scheduler executes relatively
          infrequently.

          5.5.2 Medium Term Scheduling

          Medium term scheduling is essentially concerned with memory management, hence it’s very
          often designed as a part of the memory management subsystem of an OS. Its effi cient interaction
          with the short term scheduler is essential for system performances, especially in virtual memory




                                           LOVELY PROFESSIONAL UNIVERSITY                                    85
   87   88   89   90   91   92   93   94   95   96   97