Page 96 - DCAP403_Operating System
P. 96

Unit 5: Scheduling





                                   Figure 5.10: Multi-processor Queue                           Notes
                                     RQ0                              Release
                     Admit
                                                           Processor






                                     RQ1                              Release
                                                           Processor






                                     RQ2                              Release
                                                           Processor





          5.7 Thread Scheduling

          The main approaches of threading scheduling are:
          1.   Load sharing
          2.   Gang scheduling

          3.   Dedicated processor assignment
          4.   Dynamic scheduling

          5.7.1 Load Sharing

          Processes are not assigned to a particular processor. A global queue of ready threads is maintained
          and each processor, when idle select a thread from the queue.

          There are three versions of load sharing are these are:
          1.   First come fi rst served
          2.   Smallest number of threads fi rst
          3.   Preemptive smallest number of threads fi rst
          1.   First come fi rst served: when a job arrives each of its threads is placed consecutively at the
               end of the shared queue. When a processor becomes idle it picks the next ready thread,
               which it executes until completion or blocking.

          2.   Smallest number of thread fi rst: The shared ready queue is organized as a priority queue
               with highest priority given to threads from jobs with the smallest number of unscheduled
               threads. Jobs of equal priority are ordered according to which job arrives fi rst.

          3.   Preemptive smallest number of threads fi rst: Highest is given to jobs with the smallest
               number of incomplete threads.








                                           LOVELY PROFESSIONAL UNIVERSITY                                    89
   91   92   93   94   95   96   97   98   99   100   101