1 / 129

Processor Scheduling

Processor Scheduling. Scheduling is the activity of selecting the next Job / Process / Request to be handled by a Server/CPU. Preemption Scheduling : A request being processed is preempted in order to provide service to other requests in the system.

hawa
Download Presentation

Processor 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. Processor Scheduling Scheduling is the activity of selecting the next Job / Process / Request to be handled by a Server/CPU. Preemption Scheduling: A request being processed is preempted in order to provide service to other requests in the system. It is for providing fair services to all the requests, or servicing the superior request. Non Preemptive Scheduling: A nonpreemptive scheduling / server always processes a scheduled request / job to completion. OS/ProcSche/NI2008

  2. CPU scheduling criteria • CPU Utilization – Percentage of Time that the processor is busy. • Throughput – how many jobs finished/unit time? • No of processes completed per unit of time. • Turnaround Time –how long from job submission to job termination? • Interval of time between the submission of a process and its completion. Includes actual execution time + time spent waiting for resources, including the processor. • Response Time – how long (on average) does it take to get a “response”? • For an interactive process, this is the time from submission of a request/job until the response begins to be received. • Missed deadlines – were any deadlines missed? OS/ProcSche/NI2008

  3. CPU scheduling criteria • Delay Time / CPU Latency Time: • Delay caused in selecting a process for execution • Burst/Service Time: • Actual time taken by CPU to completes the process • Weighted Turn around time: • Ratio of the turn around time of a job/process to its own execution requirements. • Deadline: • Time by which a job/process must be completed • Deadline Overrun: • The amount of time by which the deadline of a job/process is exceeded. It can be both positive or negative. • Schedule Length: The total time taken to complete a set of jobs/processes submitted to a server. OS/ProcSche/NI2008

  4. Scheduler options • Priorities • May use priorities to determine who runs next • Amount of memory, Order of arrival, etc.. • Dynamic vs. Static algorithms • Dynamically alter the priority of the tasks while they are in the system (possibly with feedback) • Static algorithms typically assign a fixed priority when the job is initially started. • Preemptive vs. Nonpreemptive • Preemptive systems allow the task to be interrupted at any time so that the O.S. can take over again. OS/ProcSche/NI2008

  5. Types of Scheduling • Scheduling is split into three steps/levels/stages • Long Term Scheduling / Admission Scheduler • ( New state / Admit state) to Ready • Medium Term Scheduling / Memory Scheduler • ( Ready / Suspended / Blocked / waiting) • Short Term Scheduler / CPU scheduler • ( Preemptive / Non-Preemptive) • ( Ready to Running State) OS/ProcSche/NI2008

  6. Types of Scheduling • Long Term Scheduling: • When to initiate the processing of a job / process. Which programs are admitted to the system for processing. The others are kept in the input queue until they are selected. • Allocates necessary resources • Make it ready to send to the Medium Term Scheduler. • Medium Term Scheduler: • MTS keeps track of states of processes admitted for processing and prepares for execution on the CPU. • It determines which processes should be kept in memory and which one kept on disk (virtual memory). • The decision to add to the number of processes that are partially or fully in main memory. • Performs memory swapping in/out. OS/ProcSche/NI2008

  7. Types of Scheduling • Short Term Scheduling: The short term scheduler is invoked whenever an event occurs that may lead to the suspension of the current process or that may provide an opportunity to preempt a currently running process in favor of another. Event are . • Clock interrupts • I/O interrupts • Operating system calls • Signals STS picks one process from the list of ready processes for execution on the CPU, and hands it to the Dispatching Mechanism. Dispatching loads the state of the selected process – contents of the PSW and CPU registers – into the CPU and allows the CPU to resume execution of the process. OS/ProcSche/NI2008

  8. Scheduling policies / Algorithms • First-Come, First Served (FIFO) • Shortest Job First (non-preemeptive) • Shortest Job First (with preemption) ( Shortest Remaining Time Next ) • Highest Response Ratio Next Scheduling • Shortest Job Next • Deadline Scheduling • Priority Scheduling • Real-Time Scheduling • Round-Robin Scheduling OS/ProcSche/NI2008

  9. Scheduling policies (Preemptive) • Round Robin Scheduling • Heavily loaded system • Two Queues • Multiple Queues • Guaranteed Scheduling • Lottery Scheduling • Fair Share scheduling OS/ProcSche/NI2008

  10. First-Come, First-Served (FIFO) • Start jobs in the order they arrive (FIFO queue) • Run each job until completion OS/ProcSche/NI2008

  11. First-Come, First-Served (FIFO) • Start jobs in the order they arrive (FIFO queue) • Run each job until completion Arrival Processing Process Time Time 1 0 3 2 2 6 3 4 4 4 6 5 5 8 2 OS/ProcSche/NI2008

  12. First-Come, First-Served (FIFO) Total time taken, from submission to completion • Start jobs in the order they arrive (FIFO queue) • Run each job until completion Arrival Processing Turnaround Process Time Time Delay Time 1 0 3 2 2 6 3 4 4 4 6 5 5 8 2 OS/ProcSche/NI2008

  13. 0 5 10 15 20 First-Come, First-Served (FIFO) Total time taken, from submission to completion • Start jobs in the order they arrive (FIFO queue) • Run each job until completion Arrival Processing Turnaround Process Time Time Delay Time 1 0 3 2 2 6 3 4 4 4 6 5 5 8 2 Arrival Times of the Jobs OS/ProcSche/NI2008

  14. 0 5 10 15 20 First-Come, First-Served (FIFO) Total time taken, from submission to completion • Start jobs in the order they arrive (FIFO queue) • Run each job until completion Arrival Processing Turnaround Process Time Time Delay Time 1 0 3 2 2 6 3 4 4 4 6 5 5 8 2 OS/ProcSche/NI2008

  15. 0 5 10 15 20 First-Come, First-Served (FIFO) Total time taken, from submission to completion • Start jobs in the order they arrive (FIFO queue) • Run each job until completion Arrival Processing Turnaround Process Time Time Delay Time 1 0 3 2 2 6 3 4 4 4 6 5 5 8 2 OS/ProcSche/NI2008

  16. 0 5 10 15 20 First-Come, First-Served (FIFO) Total time taken, from submission to completion • Start jobs in the order they arrive (FIFO queue) • Run each job until completion Arrival Processing Turnaround Process Time Time Delay Time 1 0 3 2 2 6 3 4 4 4 6 5 5 8 2 OS/ProcSche/NI2008

  17. 0 5 10 15 20 First-Come, First-Served (FIFO) Total time taken, from submission to completion • Start jobs in the order they arrive (FIFO queue) • Run each job until completion Arrival Processing Turnaround Process Time Time Delay Time 1 0 3 2 2 6 3 4 4 4 6 5 5 8 2 OS/ProcSche/NI2008

  18. 0 5 10 15 20 First-Come, First-Served (FIFO) Total time taken, from submission to completion • Start jobs in the order they arrive (FIFO queue) • Run each job until completion Arrival Processing Turnaround Process Time Time Delay Time 1 0 3 2 2 6 3 4 4 4 6 5 5 8 2 OS/ProcSche/NI2008

  19. 0 5 10 15 20 First-Come, First-Served (FIFO) Total time taken, from submission to completion • Start jobs in the order they arrive (FIFO queue) • Run each job until completion Arrival Processing Turnaround Process Time Time Delay Time 1 0 3 2 2 6 3 4 4 4 6 5 5 8 2 OS/ProcSche/NI2008

  20. 0 5 10 15 20 First-Come, First-Served (FIFO) Total time taken, from submission to completion • Start jobs in the order they arrive (FIFO queue) • Run each job until completion Arrival Processing Turnaround Process Time Time Delay Time 1 0 3 2 2 6 3 4 4 4 6 5 5 8 2 OS/ProcSche/NI2008

  21. 0 5 10 15 20 First-Come, First-Served (FIFO) Total time taken, from submission to completion • Start jobs in the order they arrive (FIFO queue) • Run each job until completion Arrival Processing Turnaround Process Time Time Delay Time 1 0 3 2 2 6 3 4 4 4 6 5 5 8 2 OS/ProcSche/NI2008

  22. 0 5 10 15 20 First-Come, First-Served (FIFO) Total time taken, from submission to completion • Start jobs in the order they arrive (FIFO queue) • Run each job until completion Arrival Processing Turnaround Process Time Time Delay Time 1 0 3 2 2 6 3 4 4 4 6 5 5 8 2 OS/ProcSche/NI2008

  23. 0 5 10 15 20 First-Come, First-Served (FIFO) Total time taken, from submission to completion • Start jobs in the order they arrive (FIFO queue) • Run each job until completion Arrival Processing Turnaround Process Time Time Delay Time 1 0 3 2 2 6 3 4 4 4 6 5 5 8 2 OS/ProcSche/NI2008

  24. 0 5 10 15 20 First-Come, First-Served (FIFO) Total time taken, from submission to completion • Start jobs in the order they arrive (FIFO queue) • Run each job until completion Arrival Processing Turnaround Process Time Time Delay Time 1 0 3 2 2 6 3 4 4 4 6 5 5 8 2 OS/ProcSche/NI2008

  25. 0 5 10 15 20 First-Come, First-Served (FIFO) Total time taken, from submission to completion • Start jobs in the order they arrive (FIFO queue) • Run each job until completion Arrival Processing Turnaround Process Time Time Delay Time 1 0 3 2 2 6 3 4 4 4 6 5 5 8 2 OS/ProcSche/NI2008

  26. 0 5 10 15 20 First-Come, First-Served (FIFO) Total time taken, from submission to completion • Start jobs in the order they arrive (FIFO queue) • Run each job until completion Arrival Processing Turnaround Process Time Time Delay Time 1 0 3 0 2 2 6 1 3 4 4 5 4 6 5 7 5 8 2 10 OS/ProcSche/NI2008

  27. 0 5 10 15 20 First-Come, First-Served (FIFO) Total time taken, from submission to completion • Start jobs in the order they arrive (FIFO queue) • Run each job until completion Arrival Processing Turnaround Process Time Time Delay Time 1 0 3 0 3 2 2 6 1 7 3 4 4 5 9 4 6 5 7 12 5 8 2 10 12 OS/ProcSche/NI2008

  28. Shortest Job First • Select the job with the shortest (expected) running time • Non-Preemptive OS/ProcSche/NI2008

  29. 0 5 10 15 20 Shortest Job First • Select the job with the shortest (expected) running time • Non-Preemptive Arrival Processing Turnaround Process Time Time Delay Time 1 0 3 2 2 6 3 4 4 4 6 5 5 8 2 Same Job Mix OS/ProcSche/NI2008

  30. 0 5 10 15 20 Shortest Job First • Select the job with the shortest (expected) running time • Non-Preemptive Arrival Processing Turnaround Process Time Time Delay Time 1 0 3 2 2 6 3 4 4 4 6 5 5 8 2 OS/ProcSche/NI2008

  31. 0 5 10 15 20 Shortest Job First • Select the job with the shortest (expected) running time • Non-Preemptive Arrival Processing Turnaround Process Time Time Delay Time 1 0 3 2 2 6 3 4 4 4 6 5 5 8 2 OS/ProcSche/NI2008

  32. 0 5 10 15 20 Shortest Job First • Select the job with the shortest (expected) running time • Non-Preemptive Arrival Processing Turnaround Process Time Time Delay Time 1 0 3 2 2 6 3 4 4 4 6 5 5 8 2 OS/ProcSche/NI2008

  33. 0 5 10 15 20 Shortest Job First • Select the job with the shortest (expected) running time • Non-Preemptive Arrival Processing Turnaround Process Time Time Delay Time 1 0 3 2 2 6 3 4 4 4 6 5 5 8 2 OS/ProcSche/NI2008

  34. 0 5 10 15 20 Shortest Job First • Select the job with the shortest (expected) running time • Non-Preemptive Arrival Processing Turnaround Process Time Time Delay Time 1 0 3 2 2 6 3 4 4 4 6 5 5 8 2 OS/ProcSche/NI2008

  35. 0 5 10 15 20 Shortest Job First • Select the job with the shortest (expected) running time • Non-Preemptive Arrival Processing Turnaround Process Time Time Delay Time 1 0 3 2 2 6 3 4 4 4 6 5 5 8 2 OS/ProcSche/NI2008

  36. 0 5 10 15 20 Shortest Job First • Select the job with the shortest (expected) running time • Non-Preemptive Arrival Processing Turnaround Process Time Time Delay Time 1 0 3 2 2 6 3 4 4 4 6 5 5 8 2 OS/ProcSche/NI2008

  37. 0 5 10 15 20 Shortest Job First • Select the job with the shortest (expected) running time • Non-Preemptive Arrival Processing Turnaround Process Time Time Delay Time 1 0 3 2 2 6 3 4 4 4 6 5 5 8 2 OS/ProcSche/NI2008

  38. 0 5 10 15 20 Shortest Job First • Select the job with the shortest (expected) running time • Non-Preemptive Arrival Processing Turnaround Process Time Time Delay Time 1 0 3 2 2 6 3 4 4 4 6 5 5 8 2 OS/ProcSche/NI2008

  39. 0 5 10 15 20 Shortest Job First • Select the job with the shortest (expected) running time • Non-Preemptive Arrival Processing Turnaround Process Time Time Delay Time 1 0 3 2 2 6 3 4 4 4 6 5 5 8 2 OS/ProcSche/NI2008

  40. 0 5 10 15 20 Shortest Job First • Select the job with the shortest (expected) running time • Non-Preemptive Arrival Processing Turnaround Process Time Time Delay Time 1 0 3 2 2 6 3 4 4 4 6 5 5 8 2 OS/ProcSche/NI2008

  41. 0 5 10 15 20 Shortest Job First • Select the job with the shortest (expected) running time • Non-Preemptive Arrival Processing Turnaround Process Time Time Delay Time 1 0 3 2 2 6 3 4 4 4 6 5 5 8 2 OS/ProcSche/NI2008

  42. 0 5 10 15 20 Shortest Job First • Select the job with the shortest (expected) running time • Non-Preemptive Arrival Processing Turnaround Process Time Time Delay Time 1 0 3 0 2 2 6 1 3 4 4 7 4 6 5 9 5 8 2 1 OS/ProcSche/NI2008

  43. 0 5 10 15 20 Shortest Job First • Select the job with the shortest (expected) running time • Non-Preemptive Arrival Processing Turnaround Process Time Time Delay Time 1 0 3 0 3 2 2 6 1 7 3 4 4 7 11 4 6 5 9 14 5 8 2 1 3 OS/ProcSche/NI2008

  44. 0 5 10 15 20 Shortest Remaining Time • Preemptive version of SJF Arrival Processing Turnaround Process Time Time Delay Time 1 0 3 2 2 6 3 4 4 4 6 5 5 8 2 Same Job Mix OS/ProcSche/NI2008

  45. 0 5 10 15 20 Shortest Remaining Time • Preemptive version of SJF Arrival Processing Turnaround Process Time Time Delay Time 1 0 3 2 2 6 3 4 4 4 6 5 5 8 2 OS/ProcSche/NI2008

  46. 0 5 10 15 20 Shortest Remaining Time • Preemptive version of SJF Arrival Processing Turnaround Process Time Time Delay Time 1 0 3 2 2 6 3 4 4 4 6 5 5 8 2 OS/ProcSche/NI2008

  47. 0 5 10 15 20 Shortest Remaining Time • Preemptive version of SJF Arrival Processing Turnaround Process Time Time Delay Time 1 0 3 2 2 6 3 4 4 4 6 5 5 8 2 OS/ProcSche/NI2008

  48. 0 5 10 15 20 Shortest Remaining Time • Preemptive version of SJF Arrival Processing Turnaround Process Time Time Delay Time 1 0 3 2 2 6 3 4 4 4 6 5 5 8 2 OS/ProcSche/NI2008

  49. 0 5 10 15 20 Shortest Remaining Time • Preemptive version of SJF Arrival Processing Turnaround Process Time Time Delay Time 1 0 3 2 2 6 3 4 4 4 6 5 5 8 2 OS/ProcSche/NI2008

More Related