1 / 25

Operating System 9 UNIPROCESSOR SCHEDULING

Operating System 9 UNIPROCESSOR SCHEDULING. TYPES OF PROCESSOR SCHEDULING.

effie
Télécharger la présentation

Operating System 9 UNIPROCESSOR SCHEDULING

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Operating System 9UNIPROCESSOR SCHEDULING

  2. TYPES OF PROCESSOR SCHEDULING

  3. The aim of processor scheduling is to assign processes to be executed by theprocessor or processors over time, in a way that meets system objectives, such as responsetime, throughput, and processor efficiency. In many systems, this schedulingactivity is broken down into three separate functions: long-, medium-, and shorttermscheduling.The names suggest the relative time scales with which these functions are performed. • Long-term scheduling is performed when a new process is created. • Medium-term scheduling is a part of the swapping function. • Short-term scheduling is the actual decision of which ready process to execute next.

  4. Long-Term Scheduling • The long-term scheduler determines which programs are admitted to the system forprocessing. Thus, it controls the degree of multiprogramming. • The decision as to when to create a new process is generally driven by the desireddegree of multiprogramming.The more processes that are created, the smaller is the percentage of time that each process can be executed (i.e., more processes arecompeting for the same amount of processor time).

  5. Medium-Term Scheduling • Medium-term scheduling is part of the swapping function. The issues involved arediscussed in Chapters 3, 7, and 8.Typically, the swapping-in decision is based on theneed to manage the degree of multiprogramming.

  6. Short-Term Scheduling • The short-term scheduler, alsoknown as the dispatcher, executes most frequently and makes the fine-grained decisionof which process to execute next. • The short-term scheduler is invoked whenever an event occurs that may lead tothe blocking of the current process

  7. SCHEDULING ALGORITHMS

  8. Short-Term Scheduling Criteria • The main objective of short-term scheduling is to allocate processor time in such away as to optimize one or more aspects of system behavior. • The commonly used criteria can be categorized along two dimensions. First,we can make a distinction between user-oriented and system-oriented criteria. Userorientedcriteria relate to the behavior of the system as perceived by the individualuser or process. An example is response time in an interactive system. • Other criteria are system oriented. That is, the focus is on effective and efficientutilization of the processor. An example is throughput. • Another dimension along which criteria can be classified is those that are performancerelated and those that are not directly performance related.

  9. > Table 9.2summarizes keyscheduling criteria.Theseare interdependent, and itis impossible to optimize all of them simultaneously.

  10. The Use of Priorities • In many systems, each process is assigned a priority and the scheduler will alwayschoose a process of higher priority over one of lower priority.

  11. Alternative Scheduling Policies • Table 9.3 presents some summary information about the various scheduling policiesthat are examined in this subsection. The selection function determines whichprocess, among ready processes, is selected next for execution.

  12. > Preemptive policies incur greater overhead than nonpreemptive ones but mayprovide better service to the total population of processes,

  13. First-Come-First-Served • The simplest scheduling policy is first-come-firstserved(FCFS), also known as first-in-first-out (FIFO)

  14. > Another difficulty with FCFS is that it tends to favor processor-bound processes over I/O-bound processes.

  15. Round Robin • A straightforward way to reduce the penalty that short jobs sufferwith FCFS is to use preemption based on a clock.The simplest such policy is roundrobin. A clock interrupt is generated at periodic intervals. • Round robin is particularly effective in a general-purpose time-sharing systemor transaction processing system. • Generally, an I/O-bound process has a shorter processor burst (amount of time spent executing betweenI/O operations) than a processor-bound process. • [HALD91] suggests a refinement to round robin that he refers to as a virtualround robin (VRR) and that avoids this unfairness. Figure 9.7 illustrates the scheme.New processes arrive and join the ready queue, which is managed on an FCFS basis.When a running process times out, it is returned to the ready queue. • When a process is dispatchedfrom the auxiliary queue, it runs no longer than a time equal to the basictime quantum minus the total time spent running since it was last selected from the main ready queue.

  16. Shortest Process Next • > Another approach to reducing the bias in favor of longprocesses inherent in FCFS is the Shortest ProcessNext (SPN) policy. This is a nonpreemptive policy in which the process with the shortest expected processing time isselected next.Thus a short process will jump to the head of the queue past longer jobs. • > One difficulty with the SPN policy is the need to know orat least estimate the requiredprocessing time of eachprocess.

  17. A risk with SPN is the possibility of starvation for longer processes, as long asthere is a steady supply of shorter processes.

  18. Shortest Remaining Time • The shortest remaining time (SRT) policy is a preemptiveversion of SPN. In this case, the scheduler always chooses the process thathas the shortest expected remaining processing time. • In Table 9.5, we have used the normalizedturnaround time, which is the ratio of turnaround time to actual service time, as afigure of merit. For each individual process, we would like to minimize this ratio, andwe would like to minimize the average value over all processes. In general, we cannotknow ahead of time what the service time is going to be, but we can approximateit, either based on past history or some input from the user or a configuration manager.Consider the following ratio: • Thus, our scheduling rule becomes the following:When the current process completesor is blocked, choose the ready process with the greatest value of R. Highest Response Ratio Next

  19. Feedback • If we have no indication of the relative length of various processes,then none of SPN, SRT, and HRRN can be used.Another way of establishing a preferencefor shorter jobs is to penalize jobs that have been running longer. In otherwords, if we cannot focus on the time remaining to execute, let us focus on the timespent in execution so far. • > Figure 9.10 illustrates the feedbackschedulingmechanism by showing the • path that a process will follow through the various queues.5 This approach is knownasmultilevelfeedback, meaning that the operating system allocates the processor toa process and, when the process blocks or is preempted, feeds it back into one of several priority queues.

  20. Selesai....

More Related