Lecture Operating systems: Lesson 16 - Dr. Syed Mansoor Sarwar

Lecture Operating systems: Lesson 16 - Dr. Syed Mansoor Sarwar. The main topics covered in this lesson include: SJF is optimal, round-Robin scheduling, multi-level queues scheduling, multi-level feedback queues scheduling, quantum vs context switch, turnaround time vs quantum, . | Operating Systems Lecture 16 Syed Mansoor Sarwar Agenda for Today Review of previous lecture SJF is optimal Round-Robin scheduling Multi-level queues scheduling Multi-level feedback queues scheduling Recap of lecture 28 April 2022 Copyright Virtual University of Pakistan Review of Lecture 15 Shortest-Job-First SJF Shortest-Remaining-Time-First SRTF Exponential averaging Priority scheduling 28 April 2022 Copyright Virtual University of Pakistan Review of Lecture 15 Exponential Averaging n 1 tn 1- n for n 1 tn 2 tn-1 22 tn-2 23 tn-3 24 28 April 2022 Copyright Virtual University of Pakistan SJF is Optimal Logical Argument Decrease in the wait times for short processes is much more than increase in the wait times for long processes P1 P2 P3 5 3 2 P3 P2 P1 2 3 5 28 April 2022 Copyright Virtual University of Pakistan Round Robin RR Each process gets a small unit of CPU time called time slice or quantum which is usually 10- 100 milliseconds. After this time has elapsed the process is preempted and added to the end of the ready queue. 28 April 2022 Copyright Virtual University of Pakistan Round Robin RR If there are n processes in the ready queue the time quantum is q and context switch time is tcs then no process waits more than n-1 q tcs time units Used in time-sharing systems where response time is an important performance criteria 28 April 2022 Copyright Virtual University of Pakistan Round Robin RR Performance q large FCFS q small q must be large with respect to context switch otherwise overhead is too high. 28 April 2022 Copyright Virtual University of Pakistan Round Robin Example Process Burst Time P1 53 33 13 P2 17 P3 68 48 28 8 P4 24 4 The Gantt chart with quantum 20 is P1 P2 P3 P4 P1 P3 P4 P1 P3 P3 0 20 37 57 77 97 117 121 134 154 162 28 April 2022 Copyright Virtual University of Pakistan Round Robin Example Process Turnaround Time Waiting Time P1 134 134 53 81 P2 37 37 17 20 P3 162 162 68 94 P4 121 121 24 97 Average waiting time 73 Average waiting time for SJF

Không thể tạo bản xem trước, hãy bấm tải xuống
TÀI LIỆU MỚI ĐĂNG
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.