CS630 Operating System Design, First Exam, Fall 2015

Similar documents
W4118 Operating Systems. Instructor: Junfeng Yang

CPU Scheduling. CPU Scheduling

Scheduling. Yücel Saygın. These slides are based on your text book and on the slides prepared by Andrew S. Tanenbaum

Objectives. Chapter 5: Process Scheduling. Chapter 5: Process Scheduling. 5.1 Basic Concepts. To introduce CPU scheduling

Objectives. Chapter 5: CPU Scheduling. CPU Scheduler. Non-preemptive and preemptive. Dispatcher. Alternating Sequence of CPU And I/O Bursts

ICS Principles of Operating Systems

Announcements. Basic Concepts. Histogram of Typical CPU- Burst Times. Dispatcher. CPU Scheduler. Burst Cycle. Reading

Chapter 5 Process Scheduling

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

Real-Time Scheduling 1 / 39

Factors to Describe Job Shop Scheduling Problem

/ Operating Systems I. Process Scheduling. Warren R. Carithers Rob Duncan

Operating Systems. III. Scheduling.

Job Scheduling Model

Comp 204: Computer Systems and Their Implementation. Lecture 12: Scheduling Algorithms cont d

CPU Scheduling. Basic Concepts. Basic Concepts (2) Basic Concepts Scheduling Criteria Scheduling Algorithms Batch systems Interactive systems

CPU Scheduling Outline

Deciding which process to run. (Deciding which thread to run) Deciding how long the chosen process can run

Operating Systems Lecture #6: Process Management

A Comparative Study of CPU Scheduling Algorithms

Operating Systems Concepts: Chapter 7: Scheduling Strategies

A Group based Time Quantum Round Robin Algorithm using Min-Max Spread Measure

Road Map. Scheduling. Types of Scheduling. Scheduling. CPU Scheduling. Job Scheduling. Dickinson College Computer Science 354 Spring 2010.

OS OBJECTIVE QUESTIONS

PROCESS SCHEDULING ALGORITHMS: A REVIEW

Scheduling Algorithms

Main Points. Scheduling policy: what to do next, when there are multiple threads ready to run. Definitions. Uniprocessor policies

CPU Scheduling 101. The CPU scheduler makes a sequence of moves that determines the interleaving of threads.

Scheduling. Scheduling. Scheduling levels. Decision to switch the running process can take place under the following circumstances:

Scheduling policy. ULK3e 7.1. Operating Systems: Scheduling in Linux p. 1

2. is the number of processes that are completed per time unit. A) CPU utilization B) Response time C) Turnaround time D) Throughput

Operating System: Scheduling

OPERATING SYSTEMS SCHEDULING

W4118 Operating Systems. Instructor: Junfeng Yang

CPU Scheduling. Multitasking operating systems come in two flavours: cooperative multitasking and preemptive multitasking.

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

Devices and Device Controllers

Process Scheduling CS 241. February 24, Copyright University of Illinois CS 241 Staff

Linux Process Scheduling Policy

Analysis and Comparison of CPU Scheduling Algorithms

Process Scheduling. Process Scheduler. Chapter 7. Context Switch. Scheduler. Selection Strategies

Introduction. Scheduling. Types of scheduling. The basics

The International Journal Of Science & Technoledge (ISSN X)

Have both hardware and software. Want to hide the details from the programmer (user).

>

Efficient Parallel Processing on Public Cloud Servers Using Load Balancing

ò Paper reading assigned for next Thursday ò Lab 2 due next Friday ò What is cooperative multitasking? ò What is preemptive multitasking?

Readings for this topic: Silberschatz/Galvin/Gagne Chapter 5

Introduction. What is an Operating System?

I/O Management. General Computer Architecture. Goals for I/O. Levels of I/O. Naming. I/O Management. COMP755 Advanced Operating Systems 1

Notes on Continuous Random Variables

Midterm Exam #2 November 10, 1999 CS162 Operating Systems

CPU Scheduling. Core Definitions

POSIX. RTOSes Part I. POSIX Versions. POSIX Versions (2)

A Review on Load Balancing In Cloud Computing 1

CS 377: Operating Systems. Outline. A review of what you ve learned, and how it applies to a real operating system. Lecture 25 - Linux Case Study

Time Management II. June 5, Copyright 2008, Jason Paul Kazarian. All rights reserved.

Continuous Random Variables

Chapter 6 Congestion Control and Resource Allocation

Secondary Storage. Any modern computer system will incorporate (at least) two levels of storage: magnetic disk/optical devices/tape systems

OPERATING SYSTEM - VIRTUAL MEMORY

Linux scheduler history. We will be talking about the O(1) scheduler

Chapter 19: Real-Time Systems. Overview of Real-Time Systems. Objectives. System Characteristics. Features of Real-Time Systems

Lab 1 Introduction to Microsoft Project

The Normal Distribution. Alan T. Arnholt Department of Mathematical Sciences Appalachian State University

CS 3530 Operating Systems. L02 OS Intro Part 1 Dr. Ken Hoganson

A Priority based Round Robin CPU Scheduling Algorithm for Real Time Systems

Quantum StorNext. Product Brief: Distributed LAN Client

Module 8. Industrial Embedded and Communication Systems. Version 2 EE IIT, Kharagpur 1

Operating Systems, 6 th ed. Test Bank Chapter 7

Operating Systems OBJECTIVES 7.1 DEFINITION. Chapter 7. Note:

Storage. The text highlighted in green in these slides contain external hyperlinks. 1 / 14

Operating System Tutorial

Analysis of Job Scheduling Algorithms in Cloud Computing

Midterm Exam #2 Solutions November 10, 1999 CS162 Operating Systems

218 Chapter 5 CPU Scheduling

Oral Diagnosis: The Physical Exam

M0312 Assignments on Grade Tally Sheet Spring 2011 Section # Name

CPU Scheduling. CSC 256/456 - Operating Systems Fall TA: Mohammad Hedayati

Module 6. Embedded System Software. Version 2 EE IIT, Kharagpur 1

Understanding Linux on z/vm Steal Time

Timing of a Disk I/O Transfer

This tutorial will take you through step by step approach while learning Operating System concepts.

Center for Teacher Certification Austin Community College

Linux Scheduler. Linux Scheduler

Web Server Software Architectures

Department of Civil Engineering-I.I.T. Delhi CEL 899: Environmental Risk Assessment Statistics and Probability Example Part 1

Lesson Plans for (9 th Grade Main Lesson) Possibility & Probability (including Permutations and Combinations)

CPU SCHEDULING (CONT D) NESTED SCHEDULING FUNCTIONS

CDS and Clearing Limited Thapathali, Kathmandu 7 th Level (Technical) Syllabus

Pulling a Random Sample from a MAXQDA Dataset

Load Balancing Scheduling with Shortest Load First

REDUCING TIME: SCHEDULING JOB. Nisha Yadav, Nikita Chhillar, Neha jaiswal

Tenth Problem Assignment

Introduction Disks RAID Tertiary storage. Mass Storage. CMSC 412, University of Maryland. Guest lecturer: David Hovemeyer.

Transcription:

First Exam, Fall 2015 Problem 1. (25 Points) Assume that PA and PB are two distinctive programs. When PA is executed, it forks new processes executing PB at tick-marks 2 and 4. Assume that the execution of a process is divided into a sequence of CPU bursts by random disk I/O until it is done, and processes created by PA have a burst sequence of {3, 4} and processes created by PB have a burst sequence of {2, 3}. Assume that processes P 1 executing PA and process P 2 executing PB had arrived before t=0 in the order of {P 1, P 2 }. Draw a Gantt chart illustrating the scheduling if a round-robin scheduling with a time quantum of 3 is used. Assume that I/O requests will be handled in a FCFS manner and each I/O request can be completed within 4 ticks. Mark on the chart when a new process is arrived and when a process is requested an I/O. Problem 2. (25 Points) Assume that there are two processes had arrived before t=0 in the order of {P 1, P 2 }. Assume that each process was divided into a sequence of CPU bursts by random interrupts and the sequence of CPU bursts for given processes are specified as: P 1 : {2, 3} and P 2 : {3, 2}. Assume that (P 1 )=.5 and (P 2 )=.55. Use the following formula to evaluate n+1, the (n+1)th estimated burst time: time will be scheduled to use the CPU. Draw a Gantt chart illustrating this scheduling. Problem 3. (25 Points) Assume that each process fan-outs a number of threats and each threat is executed as a sequence of bursts, called micros, and the execution of a micro is counted in flashes. We assume that when a process is scheduled, its threats are executed in a priority scheduling manner and each threat can only be scheduled once within each timequantum. Assume that within each process the order of priorities is the same as the listing order of threats, i.e. the first threat has the highest priority. When a process has no more threat to run then it will be pre-empted and the next scheduled process will be started at the beginning of the next tick-mark. Assume that each tick is divided into 8 flashes and each threat can be described as a set of {[micros * flashes]}. Assume that three processes had arrived before t=0 in the order of {P 1, P 2, P 3 }: P 1 is defined as a set of {[2*2], [2*2], [1*3]}; P 2 is defined as a set of {[2*3], [1*2], [2*3]}; P 3 is defined as a set of {[2*2], [2*4]}. Draw a Gantt chart illustrating the scheduling if a round-robin scheduling with a time quantum = 1 tick is used.

First Exam, Spring 2015 Problem 1. (30 Points) Assume that all three processes have arrived before t=0 in the order of {P 1, P 2, P 3 }. Assume that each process was divided into a sequence of CPU bursts by random interrupts and the sequences of CPU bursts for given processes are specified as: P 1 : {3, 2, 4}, P 2 : {2, 4, 3}, and P 3 : {4, 3, 2}. Assume that (P 2 )=.45, (P 2 )=.55 and (P 3 )=.5. Use the following formula to evaluate n+1, the (n+1)th estimated burst time: Problem 2. (35 Points) Assume that each process fan-outs a number of threats and each threat is executed as a sequence of bursts, called micros, and the execution of a micro is counted in flashes. We assume that when a process is scheduled, its threats are executed in a round-robin manner and each threat can only be scheduled once within each timequantum. When a process has no more threat to run then it will be pre-empted and the next scheduled process will be started at the beginning of the next tick-mark. Assume that each tick is divided into 8 flashes and each threat can be described as a set of {[micros * flashes]}. Assume that three processes had arrived before t=0 in the order of {P 1, P 2, P 3 }: P 1 is defined as a set of {[5*4], [3*3], [4*4]}; P 2 is defined as a set of {[3*4], [5*4], [4*3]}; P 3 is defined as a set of {[5*4], [5*4]}. Draw a Gantt chart illustrating the scheduling if a round-robin scheduling with a time quantum = 2 ticks is used. Problem 3. (35 Points) Assume that PA and PB are two distinctive programs. When PA is executed, it forks new processes executing PB at tick-mark 4 and 7. Assume that the execution of a process is divided into a sequence of CPU bursts by random disk I/O until it is done, and processes created by PA have a burst sequence of {3, 2, 4} and processes created by PB have a burst sequence of {2, 3, 2}. Assume that two processes P 1 and P 2, both executing PA, had arrived before t=0. Draw a Gantt chart illustrating the scheduling if a round-robin scheduling with a time quantum of 3 is used. Assume that I/O requests will be handled in a FCFS manner and each I/O request can be completed within 4 ticks. Mark on the chart when a new process is forked and a process has done its execution.

First Exam, Fall 2014, Problem 1. (35 Points) Assume that PA and PB are two distinguished programs. When PA is executed, it needs 10 ticks to complete its execution and it forks new processes executing PB at tick-marks 2, 4 and 7. Similarly, PB needs 5 ticks to complete its execution and it forks a new process executing PB at tick-mark 2. Assume that two processes P1 and P2 have arrived before t=0 and P1 is executing program PA while P2 is executing PB. Draw a Gantt chart illustrating the scheduling of these processes until P1 is done assume that a round-robin scheduling with a time quantum of 4 is used. Problem 2. (20 Points) Assume that we have a computer system which is using both priority scheduling and round-robin scheduling. Assume that each background process has a priority of 5; and a foreground process has a higher priority of 0 but its priority will drop 1 after each tick of execution until its priority returns to the lowest of 5. Assume that we set the current running process as a foreground process at t=8 and then every 17 ticks after that. Assume that a background process has a time-quantum of 3 ticks; and if it is becoming foreground the process will continue to execute until its priority drops to 5. Assume that we have 4 processes {P 1, P 2, P 3, P 4 } before t=0 and each of them has an identical burst-time of 20. Draw a Gantt chart illustrating the scheduling. Problem 3. (30 Points) Assume that each process was divided into a sequence of CPU bursts by random interrupts. Assume that all three processes have arrived before t=0 in the order of {P 1, P 2, P 3 }. Assume that their sequences of CPU bursts are specified as: P 1 : {3, 4}, P 2 : {2, 5}, and P 3 : {5, 4}. Assume that these processes have the same value of.5. Use the following formula to Problem 4. (15 Points) Assume that all the processes are running long enough to be considered as they can execute forever. Assume that all these N processes are grouped into two families, with N > 3. Family A contains only one process {P i } and Family B contains the rest of the processes; and i can be any number between 1 and N. Assume that all the processes in Family B will share 1/3 of the CPU time while the process in Family A takes the rest of the CPU time; i.e. Pi uses 2/3 the CPU time and each of the rest of processes uses 1/(3(N-1)). How to make this scheduling work? Hint: you can use priority. No, UNIX s Fair Share Scheduling method cannot be used.

First Exam, Spring 2014, Problem 1. (40 Points) Assume that each process fan-outs a number of threats and each threat is executed as a sequence of sub-bursts; and we assume that when a process is scheduled, its threats are executed in a round-robin manner and each threat can only be scheduled once within each time-quantum. When a process has no more threat to run then it will be pre-empted and the next scheduled process will be started at the beginning of the next tick. Assume that each tick is divided into 10 flashes. Let us call segments of a subburst a micro and the execution of a micro is counted in flashes. Assume that P 1, P 2 and P 3 are three distinctive processes and each can be described as a set of {[n*m]} where n is the number of micros and m is burst-time in flashes: P 1 is defined as a set of {[6*3], [3*5], [5*4]}; P 2 is defined as a set of {[5*4], [6*5], [3*4]}; P 3 is defined as a set of {[7*3], [7*3]}. Assume that all three processes had arrived before t=0 in the order of {P 1, P 2, P 3 }. Draw a Gantt chart illustrating the scheduling if a round-robin scheduling. Problem 2. (35 Points) Assume that each process was divided into a sequence of CPU bursts by random interrupts. Assume that all three processes had arrived before t=0 in the order of {P 1, P 2, P 3 }. Assume their sequences of CPU bursts are specified as: P 1 : {5, 4, 2}, P 2 : {4, 6, 3}, and P 3 : {3, 5, 4}. Assume that these processes have the same value of.4. Use the following formula to and t o =0 and o =5 for all processes. Draw a Gantt chart illustrating the scheduling if a *predicted* Shortest Job First scheduling is used. Problem 3. (25 Points) Assume that we have a customized personal computer which is using both priority scheduling and round-robin scheduling schema. Assume that each background process has a priority of Regular and a time-quantum of 2 ticks; and a foreground process has a higher priority of Higher and a longer time-quantum of 5 ticks. Assume that we have 4 processes {P 1, P 2, P 3, P 4 } in this system before t=0 and each of them has a burst-time longer enough to be considered as they can run forever. Assume that we randomly choose the current executing process becomes a foreground processes every 13 ticks after t=0. The selected process will jump to Higher queue and it gets an extra 3 ticks of execution as the time quantum becomes longer; and it will return to the Regular queue after it is time-out. Draw a Gantt chart illustrating the scheduling.

First Exam, Fall 2014, Name: The page is the cover page to your answer sheets and show your work. Problem 1. (35 Points) Assume that PA and PB are two distinguished programs. When PA is executed, it needs 10 ticks to complete its execution and it forks new processes executing PB at tick-marks 2, 4 and 7. Similarly, PB needs 5 ticks to complete its execution and it forks a new process executing PB at tick-mark 2. Assume that two processes P1 and P2 have arrived before t=0 and P1 is executing program PA while P2 is executing PB. Draw a Gantt chart illustrating the scheduling of these processes until P1 is done assume that a round-robin scheduling with a time quantum of 4 is used. Problem 2. (20 Points) Assume that we have a computer system which is using both priority scheduling and round-robin scheduling. Assume that each background process has a priority of 5; and a foreground process has a higher priority of 0 but its priority will drop 1 after each tick of execution until its priority returns to the lowest of 5. Assume that we set the current running process as a foreground process at t=8 and then every 17 ticks after that. Assume that a background process has a time-quantum of 3 ticks; and if it is becoming foreground the process will continue to execute until its priority drops to 5. Assume that we have 4 processes {P 1, P 2, P 3, P 4 } before t=0 and each of them has an identical burst-time of 20. Draw a Gantt chart illustrating the scheduling. Problem 3. (30 Points) Assume that each process was divided into a sequence of CPU bursts by random interrupts. Assume that all three processes have arrived before t=0 in the order of {P 1, P 2, P 3 }. Assume that their sequences of CPU bursts are specified as: P 1 : {3, 4}, P 2 : {2, 5}, and P 3 : {5, 4}. Assume that these processes have the same value of.5. Use the following formula to Problem 4. (15 Points) Assume that all the processes are running long enough to be considered as they can execute forever. Assume that all these N processes are grouped into two families, with N > 3. Family A contains only one process {P i } and Family B contains the rest of the processes; and i can be any number between 1 and N. Assume that all the processes in Family B will share 1/3 of the CPU time while the process in Family A takes the rest of the CPU time; i.e. Pi uses 2/3 the CPU time and each of the rest of processes uses 1/(3(N-1)). How to make this scheduling work? Hint: you can use priority. No, UNIX s Fair Share Scheduling method cannot be used.