Chapter 4 4.1 Interval Scheduling

Total Page:16

File Type:pdf, Size:1020Kb

Chapter 4 4.1 Interval Scheduling 4.1 Interval Scheduling Chapter 4 Greedy Algorithms Slides by Kevin Wayne. Copyright © 2005 Pearson-Addison Wesley. All rights reserved. 1 Interval Scheduling Interval Scheduling: Greedy Algorithms Interval scheduling. Greedy template. Consider jobs in some natural order. Job j starts at sj and finishes at fj. Take each job provided it's compatible with the ones already taken. Two jobs compatible if they don't overlap. Goal: find maximum subset of mutually compatible jobs. [Earliest start time] Consider jobs in ascending order of sj. [Earliest finish time] Consider jobs in ascending order of fj. a [Shortest interval] Consider jobs in ascending order of f - s . b j j c [Fewest conflicts] For each job j, count the number of d conflicting jobs cj. Schedule in ascending order of cj. e f g h Time 0 1 2 3 4 5 6 7 8 9 10 11 3 4 Interval Scheduling: Greedy Algorithms Interval Scheduling: Greedy Algorithm Greedy template. Consider jobs in some natural order. Greedy algorithm. Consider jobs in increasing order of finish time. Take each job provided it's compatible with the ones already taken. Take each job provided it's compatible with the ones already taken. Sort jobs by finish times so that f1 ≤ f2 ≤ ... ≤ fn. counterexample for earliest start time set of jobs selected A ← φ for j = 1 to n { counterexample for shortest interval if (job j compatible with A) A ← A ∪ {j} } return A counterexample for fewest conflicts Implementation. O(n log n). Remember job j* that was added last to A. Job j is compatible with A if sj ≥ fj*. 5 6 Interval Scheduling: Analysis Interval Scheduling: Analysis Theorem. Greedy algorithm is optimal. Theorem. Greedy algorithm is optimal. Pf. (by contradiction) Pf. (by contradiction) Assume greedy is not optimal, and let's see what happens. Assume greedy is not optimal, and let's see what happens. Let i1, i2, ... ik denote set of jobs selected by greedy. Let i1, i2, ... ik denote set of jobs selected by greedy. Let j1, j2, ... jm denote set of jobs in the optimal solution with Let j1, j2, ... jm denote set of jobs in the optimal solution with i1 = j1, i2 = j2, ..., ir = jr for the largest possible value of r. i1 = j1, i2 = j2, ..., ir = jr for the largest possible value of r. job ir+1 finishes before jr+1 job ir+1 finishes before jr+1 Greedy: i1 i2 ir ir+1 Greedy: i1 i2 ir ir+1 OPT: j1 j2 jr jr+1 . OPT: j1 j2 jr ir+1 . why not replace job jr+1 solution still feasible and optimal, but contradicts maximality of r. with job ir+1? 7 8 Interval Partitioning 4.1 Interval Partitioning Interval partitioning. Lecture j starts at sj and finishes at fj. Goal: find minimum number of classrooms to schedule all lectures so that no two occur at the same time in the same room. Ex: This schedule uses 4 classrooms to schedule 10 lectures. 4 e j 3 c d g 2 b h 1 a f i 9 9:30 10 10:30 11 11:30 12 12:30 1 1:30 2 2:30 3 3:30 4 4:30 Time 10 Interval Partitioning Interval Partitioning: Lower Bound on Optimal Solution Interval partitioning. Def. The depth of a set of open intervals is the maximum number that Lecture j starts at sj and finishes at fj. contain any given time. Goal: find minimum number of classrooms to schedule all lectures so that no two occur at the same time in the same room. Key observation. Number of classrooms needed ≥ depth. Ex: This schedule uses only 3. Ex: Depth of schedule below = 3 ⇒ schedule below is optimal. a, b, c all contain 9:30 Q. Does there always exist a schedule equal to depth of intervals? 3 c d f j 3 c d f j 2 b g i 2 b g i 1 a e h 1 a e h 9 9:30 10 10:30 11 11:30 12 12:30 1 1:30 2 2:30 3 3:30 4 4:30 9 9:30 10 10:30 11 11:30 12 12:30 1 1:30 2 2:30 3 3:30 4 4:30 Time Time 11 12 Interval Partitioning: Greedy Algorithm Interval Partitioning: Greedy Analysis Greedy algorithm. Consider lectures in increasing order of start time: Observation. Greedy algorithm never schedules two incompatible assign lecture to any compatible classroom. lectures in the same classroom. Theorem. Greedy algorithm is optimal. Sort intervals by starting time so that s1 ≤ s2 ≤ ... ≤ sn. Pf. d ← 0 number of allocated classrooms Let d = number of classrooms that the greedy algorithm allocates. for j = 1 to n { if (lecture j is compatible with some classroom k) Classroom d is opened because we needed to schedule a job, say j, schedule lecture j in classroom k that is incompatible with all d-1 other classrooms. else These d jobs each end after sj. allocate a new classroom d + 1 schedule lecture j in classroom d + 1 Since we sorted by start time, all these incompatibilities are caused d ← d + 1 by lectures that start no later than sj. } Thus, we have d lectures overlapping at time sj + ε. Key observation ⇒ all schedules use ≥ d classrooms. ▪ Implementation. O(n log n). For each classroom k, maintain the finish time of the last job added. Keep the classrooms in a priority queue. 13 14 Scheduling to Minimizing Lateness 4.2 Scheduling to Minimize Lateness Minimizing lateness problem. Single resource processes one job at a time. Job j requires tj units of processing time and is due at time dj. If j starts at time sj, it finishes at time fj = sj + tj. Lateness: lj = max { 0, fj - dj }. Goal: schedule all jobs to minimize maximum lateness L = max lj. Ex: 1 2 3 4 5 6 tj 3 2 1 4 3 2 dj 6 8 9 9 14 15 lateness = 2 lateness = 0 max lateness = 6 d3 = 9 d2 = 8 d6 = 15 d1 = 6 d5 = 14 d4 = 9 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 Minimizing Lateness: Greedy Algorithms Minimizing Lateness: Greedy Algorithms Greedy template. Consider jobs in some order. Greedy template. Consider jobs in some order. [Shortest processing time first] Consider jobs in ascending order [Shortest processing time first] Consider jobs in ascending order of processing time tj. of processing time tj. 1 2 tj 1 10 counterexample [Earliest deadline first] Consider jobs in ascending order of dj 100 10 deadline dj. [Smallest slack] Consider jobs in ascending order of slack dj - tj. [Smallest slack] Consider jobs in ascending order of slack dj - tj. 1 2 t 1 10 j counterexample dj 2 10 17 18 Minimizing Lateness: Greedy Algorithm Minimizing Lateness: No Idle Time Greedy algorithm. Earliest deadline first. Observation. There exists an optimal schedule with no idle time. d = 4 d = 6 d = 12 0 1 2 3 4 5 6 7 8 9 10 11 Sort n jobs by deadline so that d1 ≤ d2 ≤ … ≤ dn t ← 0 for j = 1 to n d = 4 d = 6 d = 12 0 1 2 3 4 5 6 7 8 9 10 11 Assign job j to interval [t, t + tj] sj ← t, fj ← t + tj t ← t + tj output intervals [sj, fj] Observation. The greedy schedule has no idle time. max lateness = 1 d1 = 6 d2 = 8 d3 = 9 d4 = 9 d5 = 14 d6 = 15 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 19 20 Minimizing Lateness: Inversions Minimizing Lateness: Inversions Def. Given a schedule S, an inversion is a pair of jobs i and j such that: Def. Given a schedule S, an inversion is a pair of jobs i and j such that: i < j but j scheduled before i. i < j but j scheduled before i. inversion inversion fi fi before swap j i before swap j i after swap i j [ as before, we assume jobs are numbered so that d1 ≤ d2 ≤ … ≤ dn ] f'j Observation. Greedy schedule has no inversions. Claim. Swapping two consecutive, inverted jobs reduces the number of inversions by one and does not increase the max lateness. Observation. If a schedule (with no idle time) has an inversion, it has one with a pair of inverted jobs scheduled consecutively. Pf. Let l be the lateness before the swap, and let l ' be it afterwards. l 'k = lk for all k ≠ i, j " = f " # d (definition) l 'i ≤ li l j j j = fi # d j ( j finishes at time fi ) If job j is late: $ fi # di (i < j) $ l i (definition) 21 22 ! Minimizing Lateness: Analysis of Greedy Algorithm Greedy Analysis Strategies Theorem. Greedy schedule S is optimal. Greedy algorithm stays ahead. Show that after each step of the greedy Pf. Define S* to be an optimal schedule that has the fewest number of algorithm, its solution is at least as good as any other algorithm's. inversions, and let's see what happens. Can assume S* has no idle time. Structural. Discover a simple "structural" bound asserting that every If S* has no inversions, then S = S*. possible solution must have a certain value. Then show that your If S* has an inversion, let i-j be an adjacent inversion. algorithm always achieves this bound. – swapping i and j does not increase the maximum lateness and strictly decreases the number of inversions Exchange argument. Gradually transform any solution to the one found – this contradicts definition of S* ▪ by the greedy algorithm without hurting its quality.
Recommended publications
  • Division 01 – General Requirements Section 01 32 16 – Construction Progress Schedule
    DIVISION 01 – GENERAL REQUIREMENTS SECTION 01 32 16 – CONSTRUCTION PROGRESS SCHEDULE DIVISION 01 – GENERAL REQUIREMENTS SECTION 01 32 16 – CONSTRUCTION PROGRESS SCHEDULE PART 1 – GENERAL 1.01 SECTION INCLUDES A. This Section includes administrative and procedural requirements for the preparation, submittal, and maintenance of the progress schedule, reporting progress of the Work, and Contract Time adjustments, including the following: 1. Format. 2. Content. 3. Revisions to schedules. 4. Submittals. 5. Distribution. B. Refer to the General Conditions and the Agreement for definitions and specific dates of Contract Time. C. The above listed Project schedules shall be used for evaluating all issues related to time for this Contract. The Project schedules shall be updated in accordance with the requirements of this Section to reflect the actual progress of the Work and the Contractor’s current plan for the timely completion of the Work. The Project schedules shall be used by the Owner and Contractor for the following purposes as well as any other purpose where the issue of time is relevant: 1. To communicate to the Owner the Contractor’s current plan for carrying out the Work; 2. To identify work paths that is critical to the timely completion of the Work; 3. To identify upcoming activities on the Critical Path(s); 4. To evaluate the best course of action for mitigating the impact of unforeseen events; 5. As the basis for analyzing the time impact of changes in the Work; 6. As a reference in determining the cost associated with increases or decreases in the Work; 7. To identify when submittals will be submitted; 8.
    [Show full text]
  • By Philip I. Thomas
    Washington University in St. Louis Scheduling Algorithm with Optimization of Employee Satisfaction by Philip I. Thomas Senior Design Project http : ==students:cec:wustl:edu= ∼ pit1= Advised By Associate Professor Heinz Schaettler Department of Electrical and Systems Engineering May 2013 Abstract An algorithm for weekly workforce scheduling with 4-hour discrete resolution that optimizes for employee satisfaction is formulated. Parameters of employee avail- ability, employee preference, required employees per shift, and employee weekly hours are considered in a binary integer programming model designed for auto- mated schedule generation. Contents Abstracti 1 Introduction and Background1 1.1 Background...............................1 1.2 Existing Models.............................2 1.3 Motivating Example..........................2 1.4 Problem Statement...........................3 2 Approach4 2.1 Proposed Model.............................4 2.2 Project Goals..............................4 2.3 Model Design..............................5 2.4 Implementation.............................6 2.5 Usage..................................6 3 Model8 3.0.1 Indices..............................8 3.0.2 Parameters...........................8 3.0.3 Decision Variable........................8 3.1 Constraints...............................9 3.2 Employee Shift Weighting.......................9 3.3 Objective Function........................... 11 4 Implementation and Results 12 4.1 Constraints............................... 12 4.2 Excel Implementation.........................
    [Show full text]
  • Overview of Project Scheduling Following the Definition of Project Activities, the Activities Are Associated with Time to Create a Project Schedule
    Project Management Planning Development of a Project Schedule Initial Release 1.0 Date: January 1997 Overview of Project Scheduling Following the definition of project activities, the activities are associated with time to create a project schedule. The project schedule provides a graphical representation of predicted tasks, milestones, dependencies, resource requirements, task duration, and deadlines. The project’s master schedule interrelates all tasks on a common time scale. The project schedule should be detailed enough to show each WBS task to be performed, the name of the person responsible for completing the task, the start and end date of each task, and the expected duration of the task. Like the development of each of the project plan components, developing a schedule is an iterative process. Milestones may suggest additional tasks, tasks may require additional resources, and task completion may be measured by additional milestones. For large, complex projects, detailed sub-schedules may be required to show an adequate level of detail for each task. During the life of the project, actual progress is frequently compared with the original schedule. This allows for evaluation of development activities. The accuracy of the planning process can also be assessed. Basic efforts associated with developing a project schedule include the following: • Define the type of schedule • Define precise and measurable milestones • Estimate task duration • Define priorities • Define the critical path • Document assumptions • Identify risks • Review results Define the Type of Schedule The type of schedule associated with a project relates to the complexity of the implementation. For large, complex projects with a multitude of interrelated tasks, a PERT chart (or activity network) may be used.
    [Show full text]
  • Real-Time Scheduling (Part 1) (Working Draft)
    Real-Time Scheduling (Part 1) (Working Draft) Insup Lee Department of Computer and Information Science School of Engineering and Applied Science University of Pennsylvania www.cis.upenn.edu/~lee/ CIS 541, Spring 2010 Real-Time System Example • Digital control systems – periodically performs the following job: senses the system status and actuates the system according to its current status Sensor Control-Law Computation Actuator Spring ‘10 CIS 541 2 Real-Time System Example • Multimedia applications – periodically performs the following job: reads, decompresses, and displays video and audio streams Multimedia Spring ‘10 CIS 541 3 Scheduling Framework Example Digital Controller Multimedia OS Scheduler CPU Spring ‘10 CIS 541 4 Fundamental Real-Time Issue • To specify the timing constraints of real-time systems • To achieve predictability on satisfying their timing constraints, possibly, with the existence of other real-time systems Spring ‘10 CIS 541 5 Real-Time Spectrum No RT Soft RT Hard RT Computer User Internet Cruise Tele Flight Electronic simulation interface video, audio control communication control engine Spring ‘10 CIS 541 6 Real-Time Workload . Job (unit of work) o a computation, a file read, a message transmission, etc . Attributes o Resources required to make progress o Timing parameters Absolute Released Execution time deadline Relative deadline Spring ‘10 CIS 541 7 Real-Time Task . Task : a sequence of similar jobs o Periodic task (p,e) Its jobs repeat regularly Period p = inter-release time (0 < p) Execution time e = maximum execution time (0 < e < p) Utilization U = e/p 0 5 10 15 Spring ‘10 CIS 541 8 Schedulability . Property indicating whether a real-time system (a set of real-time tasks) can meet their deadlines (4,1) (5,2) (7,2) Spring ‘10 CIS 541 9 Real-Time Scheduling .
    [Show full text]
  • Planning and Scheduling in Supply Chains: an Overview of Issues in Practice
    PRODUCTION AND OPERATIONS MANAGEMENT POMS Vol. 13, No. 1, Spring 2004, pp. 77–92 issn 1059-1478 ͉ 04 ͉ 1301 ͉ 077$1.25 © 2004 Production and Operations Management Society Planning and Scheduling in Supply Chains: An Overview of Issues in Practice Stephan Kreipl • Michael Pinedo SAP Germany AG & Co.KG, Neurottstrasse 15a, 69190 Walldorf, Germany Stern School of Business, New York University, 40 West Fourth Street, New York, New York 10012 his paper gives an overview of the theory and practice of planning and scheduling in supply chains. TIt first gives an overview of the various planning and scheduling models that have been studied in the literature, including lot sizing models and machine scheduling models. It subsequently categorizes the various industrial sectors in which planning and scheduling in the supply chains are important; these industries include continuous manufacturing as well as discrete manufacturing. We then describe how planning and scheduling models can be used in the design and the development of decision support systems for planning and scheduling in supply chains and discuss in detail the implementation of such a system at the Carlsberg A/S beerbrewer in Denmark. We conclude with a discussion on the current trends in the design and the implementation of planning and scheduling systems in practice. Key words: planning; scheduling; supply chain management; enterprise resource planning (ERP) sys- tems; multi-echelon inventory control Submissions and Acceptance: Received October 2002; revisions received April 2003; accepted July 2003. 1. Introduction taking into account inventory holding costs and trans- This paper focuses on models and solution ap- portation costs.
    [Show full text]
  • Scheduling: Introduction
    7 Scheduling: Introduction By now low-level mechanisms of running processes (e.g., context switch- ing) should be clear; if they are not, go back a chapter or two, and read the description of how that stuff works again. However, we have yet to un- derstand the high-level policies that an OS scheduler employs. We will now do just that, presenting a series of scheduling policies (sometimes called disciplines) that various smart and hard-working people have de- veloped over the years. The origins of scheduling, in fact, predate computer systems; early approaches were taken from the field of operations management and ap- plied to computers. This reality should be no surprise: assembly lines and many other human endeavors also require scheduling, and many of the same concerns exist therein, including a laser-like desire for efficiency. And thus, our problem: THE CRUX: HOW TO DEVELOP SCHEDULING POLICY How should we develop a basic framework for thinking about scheduling policies? What are the key assumptions? What metrics are important? What basic approaches have been used in the earliest of com- puter systems? 7.1 Workload Assumptions Before getting into the range of possible policies, let us first make a number of simplifying assumptions about the processes running in the system, sometimes collectively called the workload. Determining the workload is a critical part of building policies, and the more you know about workload, the more fine-tuned your policy can be. The workload assumptions we make here are mostly unrealistic, but that is alright (for now), because we will relax them as we go, and even- tually develop what we will refer to as ..
    [Show full text]
  • Optimal Instruction Scheduling Using Integer Programming
    Optimal Instruction Scheduling Using Integer Programming Kent Wilken Jack Liu Mark He ernan Department of Electrical and Computer Engineering UniversityofCalifornia,Davis, CA 95616 fwilken,jjliu,[email protected] Abstract { This paper presents a new approach to 1.1 Lo cal Instruction Scheduling local instruction scheduling based on integer programming The lo cal instruction scheduling problem is to nd a min- that produces optimal instruction schedules in a reasonable imum length instruction schedule for a basic blo ck. This time, even for very large basic blocks. The new approach instruction scheduling problem b ecomes complicated (inter- rst uses a set of graph transformations to simplify the data- esting) for pip elined pro cessors b ecause of data hazards and dependency graph while preserving the optimality of the nal structural hazards [11 ]. A data hazard o ccurs when an in- schedule. The simpli edgraph results in a simpli ed integer struction i pro duces a result that is used bya following in- program which can be solved much faster. A new integer- struction j, and it is necessary to delay j's execution until programming formulation is then applied to the simpli ed i's result is available. A structural hazard o ccurs when a graph. Various techniques are used to simplify the formu- resource limitation causes an instruction's execution to b e lation, resulting in fewer integer-program variables, fewer delayed. integer-program constraints and fewer terms in some of the The complexity of lo cal instruction scheduling can de- remaining constraints, thus reducing integer-program solu- p end on the maximum data-hazard latency which occurs tion time.
    [Show full text]
  • Scheduling College Classes Using Operations Research Techniques Barry E
    A03 - 2008 Scheduling College Classes Using Operations Research Techniques Barry E. King, Butler University, Indianapolis, IN Terri Friel, Roosevelt University, Chicago, IL ABSTRACT This paper outlines efforts taken at Butler University’s College of Business Administration to construct semester class schedules using a mixed integer linear programming problem to develop a schedule of classes and an assignment procedure to assign faculty to the schedule. It also discusses our experiences with the effort and suggestions for improvement. INTRODUCTION At Butler University, multiple sections of classes are scheduled in an attempt to give students a wide choice of options in constructing their individual class schedule. Many constraints are imposed such as not having senior level classes on Fridays so seniors can better participate in internship activities and not having junior and senior classes in the same discipline offered at the same day and time. There is also desire from administration to spread the classes out during the day to avoid an unusual number of classes being offered during the prime late morning and early afternoon hours thus better using classroom facilities. BACKGROUND The literature is full of course scheduling research. An early work by Shih and Sullivan [4] discusses course scheduling via zero-one programming but the work was hampered by the lack of adequate solvers of the time. Mooney, Rardin, and Parmenter [3] discuss large-scale classroom scheduling at Purdue University. Dinkel, Mote, and Venkataramanan [1] and Fizzano, and Swanson [2] discuss heuristics for classroom and course scheduling. Wang [5] uses a genetic algorithm to solve a course scheduling problem. Our work departs from these previous efforts in that it takes a two-stage optimization approach to the problem faced at Butler University and solves the problem with solvers available through SAS.
    [Show full text]
  • Section 5: Schedule Management Schedule Management
    Section 5: Schedule Management Schedule Management We (PMs) do not manage time; we manage our use of time -James J O’Brien 2 Schedule Management Plan The Schedule Management Plan Project Delivery Plan describes the processes that will 1. Risk Management be used to help ensure the timely 2. Roles & Responsibilities completion of the project. 3. Scope Management 4. Cost Management 5. Schedule Management 6. Change Management 7. Procurement Management 8. Communications Management 9. Quality Management 10. Transition to Construction Plan 3 Schedule Management This topic covers the following: • Learning Objectives • Why does the PDP include a Schedule Management Plan? • Example of a Schedule Management Plan • What is the PM’s Role in Schedule Management? • How do you create a Schedule Management Plan? • Project Management Tool: The CPM Schedule • Class Exercises & Quiz • Summary 4 Learning Objectives Participants will: • Recognize the value and purpose of a Schedule Management Plan • Be able to complete a Schedule Management Plan • Be familiar with the Preconstruction Schedule Template 5 Why Include a Schedule Management Plan? Accurately estimating and managing project schedules is important to managing CDOT’s construction program. • The schedule indicates whether a project will make the Ad Date. The “Start Construction” and “End Construction” milestones predict when construction funds will be spent. • Managing expenditures helps CDOT to honor commitments to the Transportation Commission, the contracting community, and the public. • Bye-bye SPI ! Hello Ad-date Float! 6 Why Include a Schedule Management Plan? The Project Schedule provides estimated completion dates for project milestones in SAP. These milestones are used to report project progress.
    [Show full text]
  • OATT Schedule 22
    SCHEDULE 22 LARGE GENERATOR INTERCONNECTION PROCEDURES Effective Date: 7/20/2021 - Docket #: ER21-1974-000 TABLE OF CONTENTS SECTION 1. DEFINITIONS SECTION 2. SCOPE, APPLICATION AND TIME REQUIREMENTS. 2.1 Application of Standard Large Generator Interconnection Procedures. 2.2 Comparability 2.3 Base Case Data 2.4 No Applicability to Transmission Service 2.5 Time Requirements SECTION 3. INTERCONNECTION REQUESTS 3.1 General 3.2 Type of Interconnection Services and Long Lead Time Facility Treatment 3.3 Utilization of Surplus Interconnection Service 3.4 Valid Interconnection Request 3.5 OASIS Posting 3.6 Coordination with Affected Systems 3.7 Withdrawal 3.8 Identification of Contingent Facilities SECTION 4. QUEUE POSITION 4.1 General 4.2 Clustering 4.3 Transferability of Queue Position 4.4 Modifications SECTION 5. PROCEDURES FOR TRANSITION 5.1 Queue Position for Pending Requests 5.2 Grandfathering 5.3 New System Operator or Interconnecting Transmission Owner SECTION 6. INTERCONNECTION FEASIBILITY STUDY 6.1 Interconnection Feasibility Study Agreement 6.2 Scope of Interconnection Feasibility Study Effective Date: 7/20/2021 - Docket #: ER21-1974-000 6.3 Interconnection Feasibility Study Procedures 6.4 Re-Study SECTION 7. INTERCONNECTION SYSTEM IMPACT STUDY 7.1 Interconnection System Impact Study Agreement 7.2 Execution of Interconnection System Impact Study Agreement 7.3 Scope of Interconnection System Impact Study 7.4 Interconnection System Impact Study Procedures 7.5 Meeting with Parties 7.6 Re-Study 7.7 Operational Readiness SECTION 8. INTERCONNECTION FACILITIES STUDY 8.1 Interconnection Facilities Study Agreement 8.2 Scope of Interconnection Facilities Study 8.3 Interconnection Facilities Study Procedures 8.4 Meeting with Parties 8.5 Re-Study SECTION 9.
    [Show full text]
  • CPU Scheduling (Chapters 7-11)
    CPU Scheduling (Chapters 7-11) CS 4410 Operating Systems [R. Agarwal, L. Alvisi, A. Bracy, M. George, F.B. Schneider, E.G. Sirer, R. Van Renesse] Separating Mechanism and Policy In this case: • mechanism: - context switch between processes • policy: - scheduling: which process to run next An important principle in systems design 2 Kernel Operation (conceptual, simplified) 1. Initialize devices 2. Initialize “first process” 3. while (TRUE) { • while device interrupts pending - handle device interrupts • while system calls pending - handle system calls • if run queue is non-empty - select process and switch to it • otherwise - wait for device interrupt } 3 The Problem You’re the cook at State Street Diner • customers continuously enter and place orders 24 hours a day • dishes take varying amounts to prepare What is your goal? • minimize average turnaround time? • minimize maximum turnaround time? Which strategy achieves your goal? 4 Different goals What if instead you are: • the owner of an expensive container ship and have cargo across the world • the head nurse managing the waiting room of the emergency room • a student who has to do homework in various classes, hang out with other students, eat, and occasionally sleep 5 Schedulers in the OS • CPU Scheduler selects a process to run from the run queue • Disk Scheduler selects next read/write operation • Network Scheduler selects next packet to send or process • Page Replacement Scheduler selects page to evict Today we’ll focus on CPU Scheduling 6 Process Model Processes switch between
    [Show full text]
  • Scheduling in Distributed Systems: a Cloud Computing Perspective Luiz F
    Computer Science Review 30 (2018) 31–54 Contents lists available at ScienceDirect Computer Science Review journal homepage: www.elsevier.com/locate/cosrev Review article Scheduling in distributed systems: A cloud computing perspective Luiz F. Bittencourt a,*, Alfredo Goldman b, Edmundo R.M. Madeira a, Nelson L.S. da Fonseca a, Rizos Sakellariou c a Institute of Computing, University of Campinas, Brazil b Instituto de Matemática e Estatística, Universidade de São Paulo, Brazil c School of Computer Science, University of Manchester, UK article info a b s t r a c t Article history: Scheduling is essentially a decision-making process that enables resource sharing among a number of Received 25 April 2018 activities by determining their execution order on the set of available resources. The emergence of Received in revised form 15 August 2018 distributed systems brought new challenges on scheduling in computer systems, including clusters, grids, Accepted 17 August 2018 and more recently clouds. On the other hand, the plethora of research makes it hard for both newcomers Available online 13 September 2018 researchers to understand the relationship among different scheduling problems and strategies proposed in the literature, which hampers the identification of new and relevant research avenues. In this paper Keywords: Distributed systems we introduce a classification of the scheduling problem in distributed systems by presenting a taxonomy Scheduling that incorporates recent developments, especially those in cloud computing. We review the scheduling Cloud computing literature to corroborate the taxonomy and analyze the interest in different branches of the proposed taxonomy. Finally, we identify relevant future directions in scheduling for distributed systems.
    [Show full text]