1 / 34

Uniprocessor Scheduling

Uniprocessor Scheduling. Chapter 9. Aim of Scheduling. The key to multiprogramming is scheduling Scheduling is done to meet the goals of Response time Throughput Processor efficiency. Tanenbaum Models. Tanenbaum Models. Types of Scheduling. Three Types.

lee-quinn
Download Presentation

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. Uniprocessor Scheduling Chapter 9

  2. Aim of Scheduling • The key to multiprogramming is scheduling • Scheduling is done to meet the goals of • Response time • Throughput • Processor efficiency

  3. Tanenbaum Models

  4. Tanenbaum Models

  5. Types of Scheduling

  6. Three Types • Long term scheduling: Degree of multiprogramming in the system • Medium term scheduling: Disk to memory migration • Short term scheduling: Ready to running migration

  7. Long-Term Scheduling • Determines which programs are admitted to the system for processing • Controls the degree of multiprogramming • More processes, smaller percentage of time each process is executed

  8. Medium-Term Scheduling • Part of the swapping function • Disk to main memory (swap-in or swap-out) • Based on the need to manage the degree of multiprogramming

  9. Short-Term Scheduling • Known as the dispatcher • Executes most frequently • Invoked when an event occurs • Clock interrupts • I/O interrupts • Operating system calls • Signals

  10. Short-Tem Scheduling Criteria • User-oriented • Response Time • Elapsed time between the submission of a request until there is output. • System-oriented • Effective and efficient utilization of the processor i.e. throughput • Not important on single-user system

  11. Short-Term Scheduling Criteria • Performance-related • Quantitative • Measurable such as response time and throughput • Not performance related • Qualitative • Predictability (The system appears same to the users over a period of time)

  12. Priorities • Scheduler will always choose a process of higher priority over one of lower priority • Have multiple ready queues to represent each level of priority • Lower-priority may suffer starvation • allow a process to change its priority based on its age or execution history

  13. Decision Mode • Nonpreemptive • Once a process is in the running state, it will continue until it terminates or blocks itself for I/O • Preemptive • Currently running process may be interrupted and moved to the Ready state by the operating system • More overhead but allows for better service since any one process cannot monopolize the processor for very long

  14. Process Scheduling Example

  15. 5 0 10 15 20 First-Come-First-Served(FCFS) • Each process joins the Ready queue • When the current process ceases to execute, the oldest process in the Ready queue is selected A B C D E

  16. First-Come-First-Served(FCFS) • A short process may have to wait a very long time before it can execute • Favors processor bound processes • I/O processes have to wait until processor bound process completes • Then the I/O bound process quickly runs its processor cycle and blocks again for I/O

  17. 5 0 10 15 20 Round-Robin • Uses preemption based on a clock • An amount of time is determined that allows each process to use the processor for that length of time A B C D E

  18. Round-Robin • Clock interrupt is generated at periodic intervals • When an interrupt occurs, the currently running process is placed in the ready queue and the next ready job is selected • Known as time slicing; If slice is short, large overhead in switching tasks • If each process runs to completion, RR changes into FCFS • To avoid unfair treatment of I/O bound processes, VRR prefers older processes over newer ones

  19. 5 0 10 15 20 1 2 3 4 5 Shortest Process Next • Nonpreemptive policy to prefer short processes • Process with shortest expected processing time is selected next • Short process jumps ahead of longer processes A B C D E

  20. Shortest Process Next • How to estimate the process length? • EWMA is used to estimate duration. It gives more weight to recent burst times • Predictability of longer processes is reduced • If estimated time for process not correct, the operating system may abort it • Possibility of starvation for longer processes

  21. 5 0 10 15 20 1 2 3 4 5 Shortest Remaining Time • Preemptive version of SPN policy • Must estimate processing time • Similar features as SPN but better turnaround because a short new process is preferred A B C D E

  22. 5 0 10 15 20 Highest Response Ratio Next (HRRN) • Choose next process with the lowest ratio R where R is A B C D E 1 2 3 4 5 time spent waiting + expected service time expected service time

  23. HRRN • When a process is new, waiting time is zero • Thus the minimum value of R is 1.0 • If the process is short, R is ________? • If the process is waiting for long time, R becomes________? • Always choose the process with largest R • No starvation

  24. 5 0 10 15 20 1 2 3 4 5 Feedback • Penalize jobs that have been running longer • Don’t know remaining time process needs to execute but we know how long the process has executed • Every time a process is preempted, it is placed in a lower priority queue A B C D E

  25. Feedback Scheduling • All queues run as FCFS except for the lowest priority queue • The lowest priority queue runs as RR • The feedback scheduling may punish long processes heavily so a variation is suggested that increases the time slice as a process goes down the lower priority queues

  26. Fair-Share Scheduling • User’s application runs as a collection of processes (threads) • User is concerned about the performance of the application • If Computer Science students are running a lot of jobs on the server, Math students should not see performance degradation for their jobs • We need to make scheduling decisions based on process sets • Each user or group is allocated a weight and this weight translates to fair share

  27. Traditional UNIX Scheduling (Timeshared Interactive Model) • Multilevel feedback using round robin within each of the priority queues • Priorities are recomputed once per second (time slice = 1 second) • Base priority divides all processes into fixed bands of priority levels • Adjustment factor used to keep process in its assigned band

  28. Bands • Decreasing order of priority • Swapper • Block I/O device control • File manipulation • Character I/O device control • User processes (favoring I/O bound)

More Related