Lab 3 Process Scheduling Due date: 29-Nov-2018

Similar documents
Programming Assignment HW4: CPU Scheduling v03/17/19 6 PM Deadline March 28th, 2019, 8 PM. Late deadline with penalty March 29th, 2019, 8 PM

Programming Assignment HW5: CPU Scheduling draft v04/02/18 4 PM Deadline April 7th, 2018, 5 PM. Late deadline with penalty April 9th, 2018, 5 PM

Project 2: CPU Scheduling Simulator

Properties of Processes

Operating Systems 2014 Assignment 2: Process Scheduling

Ch 4 : CPU scheduling

CPU Scheduling. CSE 2431: Introduction to Operating Systems Reading: Chapter 6, [OSC] (except Sections )

CSSE 340 Operating Systems Project 2: CPU Scheduling Simulator

Last class: Today: CPU Scheduling. CPU Scheduling Algorithms and Systems

EECE.4810/EECE.5730: Operating Systems Spring 2018 Programming Project 3 Due 11:59 PM, Wednesday, 4/18/18 Monday, 4/30/18

CS3733: Operating Systems

Scheduling of processes

Chapter 6: CPU Scheduling. Operating System Concepts 9 th Edition

Operating System Concepts Ch. 5: Scheduling

CS370 Operating Systems

Chapter 6: CPU Scheduling. Operating System Concepts 9 th Edition

Chapter 6: CPU Scheduling

CS370 Operating Systems

Assignment 3 (Due date: Thursday, 10/15/2009, in class) Part One: Provide brief answers to the following Chapter Exercises questions:

Titolo presentazione. Scheduling. sottotitolo A.Y Milano, XX mese 20XX ACSO Tutoring MSc Eng. Michele Zanella

COSC243 Part 2: Operating Systems

Chapter 5: CPU Scheduling

CPU Scheduling Algorithms

Chapter 5: CPU Scheduling

CPU Scheduling. Basic Concepts. Histogram of CPU-burst Times. Dispatcher. CPU Scheduler. Alternating Sequence of CPU and I/O Bursts

CPU Scheduling. Rab Nawaz Jadoon. Assistant Professor DCS. Pakistan. COMSATS, Lahore. Department of Computer Science

Chap 7, 8: Scheduling. Dongkun Shin, SKKU

Announcements. Program #1. Reading. Due 2/15 at 5:00 pm. Finish scheduling Process Synchronization: Chapter 6 (8 th Ed) or Chapter 7 (6 th Ed)

Announcements. Program #1. Program #0. Reading. Is due at 9:00 AM on Thursday. Re-grade requests are due by Monday at 11:59:59 PM.

1.1 CPU I/O Burst Cycle

CPU Scheduling. Operating Systems (Fall/Winter 2018) Yajin Zhou ( Zhejiang University

CSCI 4210 Operating Systems CSCI 6140 Computer Operating Systems Project 2 (document version 1.4) CPU Scheduling Algorithms

Preview. Process Scheduler. Process Scheduling Algorithms for Batch System. Process Scheduling Algorithms for Interactive System

Course Syllabus. Operating Systems

Lecture Topics. Announcements. Today: Uniprocessor Scheduling (Stallings, chapter ) Next: Advanced Scheduling (Stallings, chapter

OPERATING SYSTEMS CS3502 Spring Processor Scheduling. Chapter 5

CS 537: Intro to Operating Systems (Fall 2017) Worksheet 3 - Scheduling & Process API Due: Sep 27 th 2017 (Wed) in-class OR Simmi before 5:30 pm

Uniprocessor Scheduling. Aim of Scheduling

Uniprocessor Scheduling. Aim of Scheduling. Types of Scheduling. Long-Term Scheduling. Chapter 9. Response time Throughput Processor efficiency

Unit 3 : Process Management

Operating Systems Unit 3

CPU Scheduling. Daniel Mosse. (Most slides are from Sherif Khattab and Silberschatz, Galvin and Gagne 2013)

Scheduling. Scheduling 1/51

8th Slide Set Operating Systems

CS307: Operating Systems

8: Scheduling. Scheduling. Mark Handley

Interactive Scheduling

Two Level Scheduling. Interactive Scheduling. Our Earlier Example. Round Robin Scheduling. Round Robin Schedule. Round Robin Schedule

Introduction to Operating Systems Prof. Chester Rebeiro Department of Computer Science and Engineering Indian Institute of Technology, Madras

Chapter 9. Uniprocessor Scheduling

Chapter 5 CPU scheduling

An Improved Priority Dynamic Quantum Time Round-Robin Scheduling Algorithm

Operating Systems. Scheduling

Lecture 5 / Chapter 6 (CPU Scheduling) Basic Concepts. Scheduling Criteria Scheduling Algorithms

Chapter 5: CPU Scheduling

Practice Exercises 305

Scheduling. Scheduling 1/51

Chapter 5: CPU Scheduling. Operating System Concepts Essentials 8 th Edition

CS370 Operating Systems

CSE 4/521 Introduction to Operating Systems

CPU scheduling. Alternating sequence of CPU and I/O bursts. P a g e 31

Uniprocessor Scheduling. Chapter 9

Multi-Level Feedback Queues

King Saud University. College of Computer & Information Sciences. Information Technology Department. IT425: Operating Systems.

Operating Systems. Lecture Process Scheduling. Golestan University. Hossein Momeni

CPU Scheduling: Objectives

Process Scheduling. Copyright : University of Illinois CS 241 Staff

CSCI 4210 Operating Systems CSCI 6140 Computer Operating Systems Project 1 (document version 1.3) Process Simulation Framework

Job Scheduling. CS170 Fall 2018

CPU Scheduling. Schedulers. CPSC 313: Intro to Computer Systems. Intro to Scheduling. Schedulers in the OS

CPU THREAD PRIORITIZATION USING A DYNAMIC QUANTUM TIME ROUND-ROBIN ALGORITHM

Scheduling. Today. Next Time Process interaction & communication

CS 3204 Operating Systems Programming Project #2 Job / CPU Scheduling Dr. Sallie Henry Spring 2001 Due on February 27, 2001.

CS 326: Operating Systems. CPU Scheduling. Lecture 6

Operating Systems. Process scheduling. Thomas Ropars.

Uniprocessor Scheduling. Basic Concepts Scheduling Criteria Scheduling Algorithms. Three level scheduling

CS370 Operating Systems

Chapter 5: Process Scheduling

CS370: System Architecture & Software [Fall 2014] Dept. Of Computer Science, Colorado State University

Project for CS503: Operating System. Simulation of CPU Scheduling

CSC Operating Systems Spring Lecture - XII Midterm Review. Tevfik Ko!ar. Louisiana State University. March 4 th, 2008.

CS630 Operating System Design, First Exam, Spring 2017,

Chapter 5: CPU Scheduling. Operating System Concepts 8 th Edition,

Operating Systems CS 323 Ms. Ines Abbes

Scheduling. The Basics

LECTURE 3:CPU SCHEDULING

PROCESS SCHEDULING II. CS124 Operating Systems Fall , Lecture 13

Chapter 6: CPU Scheduling

Start of Lecture: February 10, Chapter 6: Scheduling

Announcements. Reading. Project #1 due in 1 week at 5:00 pm Scheduling Chapter 6 (6 th ed) or Chapter 5 (8 th ed) CMSC 412 S14 (lect 5)

Chapter 5 Process Scheduling

Scheduling (Win 2K) CSE Computer Systems November 21, 2001

Chapter 9 Uniprocessor Scheduling

High level scheduling: Medium level scheduling: Low level scheduling. Scheduling 0 : Levels

Operating Systems Comprehensive Exam. Spring Student ID # 3/20/2013

Subject Name: OPERATING SYSTEMS. Subject Code: 10EC65. Prepared By: Kala H S and Remya R. Department: ECE. Date:

ALL the assignments (A1, A2, A3) and Projects (P0, P1, P2) we have done so far.

SMD149 - Operating Systems

Uniprocessor Scheduling

Round Robin (RR) ACSC 271 Operating Systems. RR Example. RR Scheduling. Lecture 9: Scheduling Algorithms

Transcription:

Introduction Lab 3 Process Scheduling Due date: 29-Nov-2018 Modern operating system employ scheduling algorithms that are based on the round-robin concept as described in class. The scheduling policy is also based on ranking processes according to their priority. Complicated algorithms are used to calculate the current priority of a process and scheduling decisions are based on the value of each process s priority. For this lab, you are to implement three scheduling algorithms in C++: a) Multi-level Feedback Queue Scheduler (MFQS) b) Real-Time Scheduler (RTS) c) Windows Hybrid Scheduler (WHS) You are also required to write a technical paper to evaluate the performance of each algorithm. The paper must comply with the IEEE paper format. The paper is worth 20% of your grade. Program Efficiency Your program must be efficient, i.e., it must not take a long time to compute the result. The following is a breakdown of the grading of this project: Stress Tests & Efficiency: 30% Correctness: 35% Analysis Paper: 20% Specs Compliance 15% MFQS You are to implement the scheduler described in class. Listed below are some of the parameters that must be considered in your simulation. 0 Number of queues: variable, upper bound = 5 (ask user to input number) 1 Scheduling algorithms for each queue: a. Round Robin for all except last queue (FCFS). b. Time quantum: doubled for each subsequent queue below it. 2 Method used to determine when to demote a process: Processes that used up their time quantum and still cannot complete are demoted. 3 Aging: A process waits in a queue for more than some specified aging interval value (value is prompted). When the aging interval expires, the process is promoted up to the next queue. For MFQS, only processes in the last queue can age. For WHS, processes in the bottom 10% of queues can age, e.g., if WHS has 100 queues, the bottom 10 queues are allowed to age.

Preemption If a process is running RR in the third queue and a new process arrives in the first queue, you allow the process in the third queue to finish its time quantum before handling the new arrival. This is applicable to all schedulers in this lab assignment. Tie Breakers Note that whenever a tie has to be resolved, the priority of the process is considered, if the tie still exists, then the smaller PID of a process is used to break the tie. An exception to this is when a process finishes its time quantum and is demoted to the queue below at the same time as a another process which is to age up to the same queue, the process that ages up will be inserted into the queue before the demoted process. For example, if we have three queues, A (top), B (middle) and C (bottom), and process 1 just finished its time quantum in queue A and is to be demoted to queue B. At the same time process 2 is supposed to age up to queue B. Process 2 will enter queue B before process 1. Real-Time Scheduler (RTS) Implement the algorithm described in class. a) Account for both soft and hard RT environments. b) Report any process that cannot be scheduled (in soft RT only) You can assume that processes do not do I/O for this scheduler. When a process cannot meet its deadline, report it and take it out of the CPU and schedule the next one. Processes that do not meet their deadlines are not allowed to run. The time spent in the CPU of the failed process should be included in the calculation of the average turnaround time and waiting time for the scheduler. Windows Hybrid Scheduler (WHS) Process priorities in WHS are dynamic. WHS keeps track of what processes are doing and adjusts their priorities periodically. Processes that have been denied the use of the CPU are boosted by dynamically increasing their priority and those running for a long time are penalized by decreasing their priority. There are basically two bands of priorities, i.e., the high band has priorities between 50 to 99, and the low band with priorities from 0 to 49. Assume that all user processes are in the low band and kernel-type processes are in the high band. Processes belonging to one band cannot move to the other band. If a process whose priority is 45 is boosted by 10, it is not allowed to move to the higher band (50-99). The priority of that process will be maxed at 49. Similarly, a process in the high band cannot be demoted to the lower band, i.e., at worst, it will get the lowest priority in the high band of 50. For both user and kernel type processes, the system boosts the dynamic priority of a process to enhance its responsiveness as follows: When a process is scheduled, it is given a quantum of time in which to run. The quantum for processes in this exercise is in clock ticks and you will have to prompt the user for it. In this exercise, time quantum values may be any number.

Promotion A process is promoted when (a) it does I/O and (b) its aging timer expires. When a process does I/O, it is preempted and sent to a wait queue. Its priority is then boosted based on the number of clock ticks it takes to do the I/O, and is subsequently sent to the appropriate priority queue after the I/O is done. For example, a process (priority = 38) does I/O at clock tick# 24 for 3 clock ticks will be put at the end of the queue with priority = 41 at clock tick# 27. Multiple processes doing I/O close together will not have to spend time in the wait queue for more than the I/O time, i.e., other processes doing I/O do not affect each other waiting in an I/O queue. They just wait for as long as their I/O burst lasts, boost their priority and join their appropriate ready queues. If a process does an I/O, it is done in the second to last clock tick of the time quantum, i.e., I/O is initiated at clock tick# 7 if the time quantum for that process is 8. E.g., a process with a time quantum of 10 and a burst of 6 does not do I/O because it finished its burst before reaching its 9 th clock tick. Not every process will do I/O, i.e., if you encounter a line in the input file that has zero I/O, it is considered CPU-bound. Every demoted process automatically resets its age timer. E.g., if a process gets demoted at clock tick# 38, its aging time will expire at clock tick# 138 and it will be promoted. Its new priority will be its current priority plus 10. Every process must watch its timer and age once its timer expires. All scheduling is done strictly by priority. The scheduler chooses the highest priority process which is ready to run. Processes are put into their respective run queues based on their priorities. Hint: use a red-black tree to represent all active priority run queues. Demotion A process is demoted only when its time quantum expires. A process s priority cannot be decreased pass its initial base priority, i.e., if a process starts out with a priority of 25, it cannot be demoted to a value < 25, while at the same time, it cannot be increased to a value > 49. In essence, any process, regardless of whether it is a user or kernel process, adheres to this rule. When a process encounters a clock interrupt (time-quantum expired), its dynamic priority is decremented by the amount of clock ticks it spent in the CPU prior to the interrupt and is placed in its corresponding priority queue. A process s priority cannot go below its original base priority. If a priority change occurs, then the scheduler locates the highest priority process which is ready to run. Otherwise, the process is placed at the end of the run queue for its priority allowing processes of equal priority to be "round robin" scheduled. Statistics For All Algorithms: 0. Process information for Gannt chart construction, e.g., start/end time spent in CPU, etc. 1. Average Waiting Time (AWT) 2. Average Turnaround Time (ATT) 3. Total number of processes scheduled (NP) Note: The use of ifdef DEBUG to turn debugging prints off for stress tests is required. Statistics for AWT, ATT, and NP must be printed at the end of each simulation for all cases.

Process Characteristics as Input Parameters The following is an example of the information that will be provided to you in your project demonstration phase: P_ID Burst Arrival Priority Deadline I/O 1 8 0 23 10 3 2 4 2 17 8 0 Here is a sample file that will be used in our demo (in that order). The values in a row are tabdelimited. Obviously, not all columns are appropriate for every scheduling algorithm. Input Sanitization When sanitizing the input do not eliminate rows automatically just because it has a negative value which is not affecting the said scheduler, i.e., if you see a row with a negative value for deadline, eliminate the row only for the Real-Time scheduler and not for the other schedulers. That row is valid because the other schedulers do not make use of the deadline. Project Requirements Your program should be menu-driven, i.e., the user should have the option of selecting any of the scheduling algorithms to run first. It is also advisable to allow users to enter interactively input values for process ID, burst times, priority, total number of processes, real-time deadline (if appropriate) and arrival times of each process. What do I look for in the output? 1. Display enough information to draw the Gantt chart for each scheduling algorithm. 2. A chronological set of statistics - in the absence of a Gannt chart - displaying the entire simulation run of any particular algorithm. It is best to output all process characteristics in one clock tick intervals. 3. Statistics for the average waiting and average turnaround time. This applies to every scheduling algorithm.

Project Submission Project is only considered completely submitted, i.e., to get a grade, if ALL items mentioned below are accomplished. 1. W drive: A directory consisting of the source code, makefile, and README files tar'ed or zipped and put under the cs452/lab3 directory on the W drive. Name your directory with both your email names, e.g., wagnerpj_tanjs_lab1.tar. 2. Email as attachment (tar ed or zipped project) and percentage workloads. 3. Technical paper focusing on your analysis. Failure to follow prescribed IEEE paper format will result in points being deducted. 4. Print, fill, and submit the lab cover page and honor code shown below. 5. Make an appointment to demo your project.

CS 452 Operating Systems Lab Assignment Cover Page Name(s) Lab Assignment No.: 2 1. Include a copy of your source code, a design document (if required), and a sample run 2. Fill in the table of contents including the names of routines and the corresponding pages. 3. Indicate the status of your program by checking one of the boxes. 4. Submit the assignment at the beginning of the class on the due date. Program Status: (check one box) Program runs with user-defined test cases. Program runs with some errors. Program compiles and runs with no output. Program does not compile. Workload: Written By Design document Paper Test cases Program modules (classes) Module name Written by Module name Written by List only major modules that are typically more than 50 lines of code Grading: Points Score Stress Tests & Efficiency 30 Correctness 35 Technical Paper 20 Specs Compliant 15 Late Penalty (20% off per day) Total 100

Honor Code Department of Computer Science University of Wisconsin Eau Claire As members of the University of Wisconsin Eau Claire community and the computer science discipline, we commit ourselves to act honestly, responsibly, and above all, with honor and integrity in all areas of campus life. We are accountable for all that we say, read, write, and do. We are responsible for the academic integrity of our work. We pledge that we will not misrepresent our work nor give or receive illicit aid. We commit ourselves to behave in a manner which demonstrates concern for the personal dignity, rights and freedoms of all members of the community and those that depend on the expertise we possess. For all course work in the Department of Computer Science, students will write and sign (if printed) the following: I have abided by the Department of Computer Science Honor Code in this work. I accept responsibility to maintain the Honor Code at all times. Name Signature Date