CS630 Operating System Design, First Exam, Spring 2017,

Similar documents
Operating Systems Comprehensive Exam. Spring Student ID # 2/17/2011

Q 1. (10 Points) Assume that a process executes the following pseudo codes:

CSC 716 Advanced Operating System Fall 2007 Exam 1. Answer all the questions. The maximum credit for each question is as shown.

EECE.4810/EECE.5730: Operating Systems Spring 2017 Homework 3 Solution

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

CS630 Operating System Design, Second Exam, Fall 2014

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

1.1 CPU I/O Burst Cycle

CS630 Operating System Design Second Exam, Spring 2015,

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

FCM 710: Architecture of Secure Operating Systems

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

Operating Systems Comprehensive Exam. Spring Student ID # 3/16/2006

( D ) 4. Which is not able to solve the race condition? (A) Test and Set Lock (B) Semaphore (C) Monitor (D) Shared memory

Operating Systems (Classroom Practice Booklet Solutions)

Properties of Processes

Operating Systems Comprehensive Exam. Fall Student ID # 10/31/2013

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

Chapter 6: CPU Scheduling

CPU Scheduling (1) CPU Scheduling (Topic 3) CPU Scheduling (2) CPU Scheduling (3) Resources fall into two classes:

SAMPLE MIDTERM QUESTIONS

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

OPERATING SYSTEMS CS3502 Spring Processor Scheduling. Chapter 5

CPU Scheduling Algorithms

Chapter 5: CPU Scheduling

CS370 Operating Systems

Operating System Concepts Ch. 5: Scheduling

Midterm Exam. October 20th, Thursday NSC

FCM 710: Architecture of Secure Operating Systems

CS3733: Operating Systems

Homework Assignment #5

MC7204 OPERATING SYSTEMS

CS370 Operating Systems

EECE.4810/EECE.5730: Operating Systems Spring Midterm Exam March 8, Name: Section: EECE.4810 (undergraduate) EECE.

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

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

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

COMP SCI 3SH3: Operating System Concepts (Term 2 Winter 2006) Test 2 February 27, 2006; Time: 50 Minutes ;. Questions Instructor: Dr.

OS Assignment II. The process of executing multiple threads simultaneously is known as multithreading.

Department of Computer applications. [Part I: Medium Answer Type Questions]

COSC243 Part 2: Operating Systems

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

8: Scheduling. Scheduling. Mark Handley

Practice Exercises 305

COMP 3361: Operating Systems 1 Midterm Winter 2009

CHAPTER 2: PROCESS MANAGEMENT

(b) External fragmentation can happen in a virtual memory paging system.

3. CPU Scheduling. Operating System Concepts with Java 8th Edition Silberschatz, Galvin and Gagn

Ch 4 : CPU scheduling

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

Course Syllabus. Operating Systems

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

Process Turnaround Time Total Wait Time P 1 12 ms 0 ms P 2 21 ms 12 ms P 3 23 ms 18 ms P 4 20 ms 17 ms

CSSE 340 Operating Systems Project 2: CPU Scheduling Simulator

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

( B ) 4. Which is not able to solve the race condition? (A) Test and Set Lock (B) Shared memory (C) Semaphore (D) Monitor

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

Chapter 6: CPU Scheduling

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

CSE 421/521 - Operating Systems Fall Lecture - VII CPU Scheduling - II. University at Buffalo

Chapter 5: CPU Scheduling

CSE473/Spring st Midterm Exam Tuesday, February 19, 2007 Professor Trent Jaeger

Chapter 5 CPU scheduling

CSE 4/521 Introduction to Operating Systems

CS 370 Operating Systems

OPERATING SYSTEMS. UNIT II Sections A, B & D. An operating system executes a variety of programs:

OS 1 st Exam Name Solution St # (Q1) (19 points) True/False. Circle the appropriate choice (there are no trick questions).

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

Operating Systems: Quiz2 December 15, Class: No. Name:

Job Scheduling. CS170 Fall 2018

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

CS370 Operating Systems

So far. Next: scheduling next process from Wait to Run. 1/31/08 CSE 30341: Operating Systems Principles

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

Sample Questions. Amir H. Payberah. Amirkabir University of Technology (Tehran Polytechnic)

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

Discussion Week 10. TA: Kyle Dewey. Tuesday, November 29, 11

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

Class average is Undergraduates are performing better. Working with low-level microcontroller timers

Scheduling. Multi-processing. Process Characterization. time. ...makes use of idle. COS450-F18-05-Scheduling - October 8, 2018

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

COMP 3361: Operating Systems 1 Final Exam Winter 2009

An Improved Priority Dynamic Quantum Time Round-Robin Scheduling Algorithm

CPU Scheduling: Objectives

OPERATING SYSTEMS. After A.S.Tanenbaum, Modern Operating Systems, 3rd edition. Uses content with permission from Assoc. Prof. Florin Fortis, PhD

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

Start of Lecture: February 10, Chapter 6: Scheduling

STUDENT NAME: STUDENT ID: Problem 1 Problem 2 Problem 3 Problem 4 Problem 5 Total

Chap 7, 8: Scheduling. Dongkun Shin, SKKU

Comp 310 Computer Systems and Organization

Unit 3 : Process Management

CPU Scheduling: Part I ( 5, SGG) Operating Systems. Autumn CS4023

CS450 OPERATING SYSTEMS FINAL EXAM ANSWER KEY

Scheduling. Scheduling 1/51

Lecture 17: Threads and Scheduling. Thursday, 05 Nov 2009

Lecture 2 Process Management

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

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

Scheduling. Scheduling 1/51

CS370 Operating Systems

Transcription:

First Exam, Spring 2017, Problem 1. (35 Points) Assume that P A, P B and P C are three distinctive programs. When P A is executed, it forks new processes executing P B at tick-marks 2, 5 and 7 and its burst time is 8; and when P B is executed, it forks a new process executing P C at tick-mark 2. Assume that the execution of both P B and P C are divided into sequences of CPU bursts by I/O requests. Assume that each I/O request can be completed within 3 ticks and all I/O requests are handled in a FCFS manner. Assume that a process running P B has a burst sequence of {4, 2} and a process running P C has a burst sequence of {2, 2}. Assume that two processes P 1 and P 2 have arrived before t=0 and P 1 is executing P A while P 2 is executing P B. Draw a Gantt chart illustrating the scheduling if a R.R. scheduling with a TQ=3 ticks is used. Mark on the chart when a new process is arrived. Problem 2. (5 Points) Extra condition for the Problem 1. Assume that a soft interrupt is caught by P 4 at t=15, when this interrupt will be handled? Problem 3. (20 Points) Assume that a file was opened and the byte-offset 8806600 (8806600 = 8600*1024 + 200) is accessed. Note that. Assume that the read/write header of the hard drive is currently located at track #123 with block #654. Assume that each track of the targeted HD contains 4096 blocks and data blocks that are associated with the targeted block are a sequence of blocks starts at virtual block #345678 (84*4096 + 1614) and each additional block is 100000 (24*4096 + 1696) blocks away. Assume that both and are given as 1 microsecond ( s). How many milliseconds (ms) are needed to load the targeted block into buffer-cache and how many blocks are directly accessed? Note that we assume that all the blocks that are involved are not used beforehand.

First Exam, Fall 2016, Problem 1. (35 Points) Assume that P A and P B are two distinctive programs. When P A is executed, it forks new processes executing P B at tick-marks 2 and 4. Assume that the execution of a process is divided into a sequence of CPU bursts by I/O requests until it is done; and assume that each I/O request can be completed within 3 ticks and I/O requests are handled in a FCFS manner. Assume that the processes running P A have a burst sequence of {3, 2, 2} and the processes running P B have a burst sequence of {2, 3}. Assume that three processes P 1, P 2 and P 3 have arrived before t=0; and P 1 is executing P B while both P 2 and P 3 are executing P A. Draw a Gantt chart illustrating the scheduling if a FCFS scheduling is used. Mark on the chart when a new process is arrived. Problem 2. (5 Points) Extra condition for the Problem 1. Assume that a soft interrupt is caught by P 4 at t=13, when this interrupt will be handled? Problem 3. (5 Points) Why the estimated SJF scheduling method will not performed well if the involving processes could not effectively divided into sequences of CPU bursts? Problem 4. (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 FCFS manner and each threat can only be scheduled once within each time-quantum. When a process has no more threat can be run then it will be pre-empted; and the next process will be scheduled at the beginning of the next tick-mark if the remaining tick is less than 4 flashes and the OS will performs a context switch at the end of each TQ no matter what. 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*5], [2*3]}; P 2 is defined as a set of {[2*2], [2*4]}; P 3 is defined as a set of {[2*5], [1*4], [2*3]}. quantum = 1 tick is used.

First Exam, Spring 2016, Problem 1. (40 Points) Assume that P A and P B are two distinctive programs. When P A is executed, it forks new processes executing P B at tick-marks 2, 4 and 6. Assume that the execution of a process is divided into a sequence of CPU bursts by random interrupts until it is done, and processes created by P A have a burst sequence of {3, 4} and processes created by P B have a burst sequence of {2, 2}. Assume that two processes P 1 and P 2 have arrived before t=0; and both executing P A. Draw a Gantt chart illustrating the scheduling if a FCFS scheduling is used. Mark on the chart when a new process is arrived. Problem 2. (20 Points) Assume that there are three processes had 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 sequence of CPU bursts for given processes are specified as: P 1 : {3, 4}, P 2 : {2, 5}, and P 3 : {2, 4}. Assume that (P 1 )=0.3, (P 2 )=0.5 and (P 3 )=0.7. Use the following formula to evaluate n+1, the (n+1)th estimated burst time: where t o =0 and o =10 for all processes. The process with the shortest estimated burst time will be scheduled to use the CPU. Draw a Gantt chart illustrating this scheduling. Problem 3. (10 Points) Assume that a given hard disk is running at 12,000 rpm, and the speed of the step motor is 1 micro-second per 2 tracks and each track contain 5000 blocks. Assume that there are two I/O requests arrived before t=0: 1st one asking for a read operation on block #457386 and the 2nd one asking for a writing operation on block #743253. Assume that the read/write header is located at track #37 and block #500 at t=0. Assume that the device is running in a first come first serve manner. Compute the time needed to finish these two I/O. Note: you need to calculate the track # and block # for each targeted block.

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: where t o =0 and o =5 for all processes. The process with the shortest estimated burst 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]}. 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: where t o =0 and o =5 for all processes. The process with the shortest estimated burst time will be scheduled to use CPU. Draw a Gantt chart illustrating this scheduling. 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 roundrobin 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-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]}. 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.