Document Details

PurposefulCalifornium6529

Uploaded by PurposefulCalifornium6529

2018

Tags

CPU scheduling operating systems algorithms computer science

Summary

This lecture covers CPU scheduling algorithms, including FCFS, SJF, and others, with examples and questions to aid in better comprehension. Key concepts in operating systems are reviewed. This lecture part 2.

Full Transcript

Chapter 5: CPU Scheduling Operating System Concepts – 10 th Edition Silberschatz, Galvin and Gagne ©2018 Outline ▪ Basic Concepts ▪ Scheduling Criteria ▪ Scheduling Algorithms Operating System Concepts – 10 th Edition...

Chapter 5: CPU Scheduling Operating System Concepts – 10 th Edition Silberschatz, Galvin and Gagne ©2018 Outline ▪ Basic Concepts ▪ Scheduling Criteria ▪ Scheduling Algorithms Operating System Concepts – 10 th Edition 5.2 Silberschatz, Galvin and Gagne ©2018 Objectives ▪ Describe various CPU scheduling algorithms ▪ Assess CPU scheduling algorithms based on scheduling criteria ▪ Explain the issues related to multiprocessor and multicore scheduling ▪ Describe various real-time scheduling algorithms Operating System Concepts – 10 th Edition 5.3 Silberschatz, Galvin and Gagne ©2018 Multilevel Queue ▪ The ready queue consists of multiple queues ▪ Multilevel queue scheduler defined by the following parameters: Number of queues Scheduling algorithms for each queue Method used to determine which queue a process will enter when that process needs service Scheduling among the queues Operating System Concepts – 10 th Edition 5.4 Silberschatz, Galvin and Gagne ©2018 Multilevel Queue ▪ With priority scheduling, have separate queues for each priority. ▪ Schedule the process in the highest-priority queue! Operating System Concepts – 10 th Edition 5.5 Silberschatz, Galvin and Gagne ©2018 Multilevel Queue ▪ Prioritization based upon process type Operating System Concepts – 10 th Edition 5.6 Silberschatz, Galvin and Gagne ©2018 Multilevel Feedback Queue ▪ A process can move between the various queues. ▪ Multilevel-feedback-queue scheduler defined by the following parameters: Number of queues Scheduling algorithms for each queue Method used to determine when to upgrade a process Method used to determine when to demote a process Method used to determine which queue a process will enter when that process needs service ▪ Aging can be implemented using multilevel feedback queue Operating System Concepts – 10 th Edition 5.7 Silberschatz, Galvin and Gagne ©2018 Example of Multilevel Feedback Queue ▪ Three queues: Q0 – RR with time quantum 8 milliseconds Q1 – RR time quantum 16 milliseconds Q2 – FCFS ▪ Scheduling A new process enters queue Q0 which is served in RR  When it gains CPU, the process receives 8 milliseconds  If it does not finish in 8 milliseconds, the process is moved to queue Q1 At Q1 job is again served in RR and receives 16 additional milliseconds  If it still does not complete, it is preempted and moved to queue Q2 Operating System Concepts – 10 th Edition 5.8 Silberschatz, Galvin and Gagne ©2018 Question 1 ▪ Using FCFS, consider the following processes with burst time. Draw Gantt chart and calculate the average waiting time and average turnaround time? Process ID Arrival Time Burst time P1 0 2 P2 1 3 P3 2 5 P4 3 4 P5 4 6 Operating System Concepts – 10 th Edition 5.9 Silberschatz, Galvin and Gagne ©2018 Question 2 ▪ Using SJF, consider the following processes with arrival time and burst time. Draw Gantt chart and calculate the average waiting time and average turnaround time? Process ID Arrival Time Burst time P1 3 1 P2 1 4 P3 4 2 P4 0 6 P5 2 3 Operating System Concepts – 10 th Edition 5.10 Silberschatz, Galvin and Gagne ©2018 Question 3 ▪ Using SRT, consider the following processes with arrival time and burst time. Draw Gantt chart and calculate the average waiting time and average turnaround time? Process ID Arrival Time Burst time P1 0 7 P2 1 5 P3 2 3 P4 3 1 P5 4 2 P6 5 1 Operating System Concepts – 10 th Edition 5.11 Silberschatz, Galvin and Gagne ©2018 Question 4 ▪ Using RR with quantum=2, consider the following processes with arrival time and burst time. Draw Gantt chart and calculate the average waiting time and average turnaround time? Process ID Arrival Time Burst time P1 0 5 P2 1 3 P3 2 1 P4 3 2 P5 4 3 Operating System Concepts – 10 th Edition 5.12 Silberschatz, Galvin and Gagne ©2018 Question 5 ▪ Using Nonpreemptive Priority Scheduling with , consider the following processes with arrival time and burst time. Draw Gantt chart and calculate the average waiting time and average turnaround time? Process ID Arrival Time Burst time Priority P1 0 4 4 P2 1 3 3 P3 2 1 2 P4 3 5 1 P5 4 2 1 Operating System Concepts – 10 th Edition 5.13 Silberschatz, Galvin and Gagne ©2018 Question 6 ▪ Using preemptive Priority Scheduling with , consider the following processes with arrival time and burst time. Draw Gantt chart and calculate the average waiting time and average turnaround time? Process ID Arrival Time Burst time Priority P1 0 4 4 P2 1 3 3 P3 2 1 2 P4 3 5 1 P5 4 2 1 Operating System Concepts – 10 th Edition 5.14 Silberschatz, Galvin and Gagne ©2018 End of Chapter 5 Operating System Concepts – 10 th Edition Silberschatz, Galvin and Gagne ©2018

Use Quizgecko on...
Browser
Browser