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

Similar documents
Properties of Processes

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

FCM 710: Architecture of Secure Operating Systems

CPU Scheduling Algorithms

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

Chapter 6: CPU Scheduling

CS630 Operating System Design, First Exam, Spring 2017,

CS370 Operating Systems

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

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

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

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

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

FCM 710: Architecture of Secure Operating Systems

Homework Assignment #5

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

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

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

Chapter 6: CPU Scheduling

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

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

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

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

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

Chapter 5: CPU Scheduling

CS3733: Operating Systems

OPERATING SYSTEMS CS3502 Spring Processor Scheduling. Chapter 5

Operating System Concepts Ch. 5: Scheduling

1.1 CPU I/O Burst Cycle

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

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

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

COMP 3361: Operating Systems 1 Midterm Winter 2009

CISC 7310X. C05: CPU Scheduling. Hui Chen Department of Computer & Information Science CUNY Brooklyn College. 3/1/2018 CUNY Brooklyn College

CHAPTER 2: PROCESS MANAGEMENT

Practice Exercises 305

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

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

Last Class: Processes

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

CSE 4/521 Introduction to Operating Systems

8: Scheduling. Scheduling. Mark Handley

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

time are in milliseconds. Compute the average turnaround time for the system taking pre-emptive shortest job first (SJF) algorithm.

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

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

SNS COLLEGE OF ENGINEERING

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

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

Chapter 5 CPU scheduling

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

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

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

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

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

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

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

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

CSSE 340 Operating Systems Project 2: CPU Scheduling Simulator

Lecture 2 Process Management

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

Scheduling. Scheduling 1/51

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

Chapter 5: CPU Scheduling

Comp 310 Computer Systems and Organization

CSE 120 Principles of Operating Systems Spring 2017

Process Scheduling. Copyright : University of Illinois CS 241 Staff

Job Scheduling. CS170 Fall 2018

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

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

CSE120 Principles of Operating Systems. Prof Yuanyuan (YY) Zhou Scheduling

MC7204 OPERATING SYSTEMS

University of Ottawa School of Information Technology and Engineering

COMP 3361: Operating Systems 1 Final Exam Winter 2009

DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING UNIT I

COSC243 Part 2: Operating Systems

Chapter 5: Process Scheduling

Scheduling. Scheduling 1/51

CPSC 457 OPERATING SYSTEMS MIDTERM EXAM SOLUTION

Student Name:.. Student ID... Course Code: CSC 227 Course Title: Semester: Fall Exercises Cover Sheet:

CHAPTER NO - 1 : Introduction:

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

OPERATING SYSTEMS. COMS W1001 Introduction to Information Science. Boyi Xie

Review. Preview. Three Level Scheduler. Scheduler. Process behavior. Effective CPU Scheduler is essential. Process Scheduling

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

CS370 Operating Systems

Starting the Threads

SAMPLE MIDTERM QUESTIONS

Uniprocessor Scheduling

University of California College of Engineering Computer Science Division- EECS. Midterm Exam March 13, 2003 CS162 Operating Systems

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

An Improved Priority Dynamic Quantum Time Round-Robin Scheduling Algorithm

EECE.4810/EECE.5730: Operating Systems Spring 2017

Chap 7, 8: Scheduling. Dongkun Shin, SKKU

INSTITUTE OF AERONAUTICAL ENGINEERING (Autonomous) Dundigal, Hyderabad

Performance Analysis of Modified Round Robin CPU Scheduling Algorithm

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

CS307: Operating Systems

Transcription:

King Saud University College of Computer & Information Sciences Information Technology Department IT425: Operating Systems Assignment 6 Second Semester 1433/1434H 2012/2013 Homework policy: 1) Copying any part of other people's solutions or from any other sources is strictly prohibited. 2) If your source is the web, write your references in details. 3) Solutions quality (understandable and organized document, not handwriting). 4) Always start doing your assignment EARLY. Waiting until the last few hours is definitely not a wise move. ------------------------------------------------------------------------------------------------------------------------------------ Question 1. Consider a system with a single processor. The system has a single disk that is available SJF to only one process at any given time non-preemptively(i.e., if one process is accessing the disk, the other process has to wait for that process to finish using the disk before it can access it). Suppose that the following three processes arrive at the times indicated in the table below. Each process makes a CPU burst, then an I/O burst to access the disk, another CPU burst, another I/O burst to access the disk and finally terminates with a CPU burst. The lengths of these bursts are given in milliseconds in the table below: Burst Time Arrival CPU burst 1 I/O burst 1 CPU burst 2 I/O burst 2 CPU burst 3 Time 1 2 4 2 2 2 0 2 2 2 3 3 1 1 3 1 2 1 1 1 1 We make the following two assumptions:

Disk queue Ready queue 1. If a new process arrives at the same time that a process finishes using the CPU, then the new process will be added to the ready queue first. 2. If an I/O completion and a CPU timeout of two processes occur at the same time, the process completing I/O is added to the ready queue first. Part A.Fill in the three Gantt charts that illustrate the execution of these processes using the following scheduling algorithms: 1. Shortest Job First (SJF) algorithm 2. Round robin (RR) algorithm with quantum = 1 On each Gantt chart, use the following symbols to indicate the state of the process: Symbol x r w i t State is running (executing) is ready is waiting is doing I/O has terminated Also show the processes on the ready queue and disk queue. 1. Shortest Job First (SJF) algorithm Time 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 (head ) (head )

Disk queue Ready queue 2. Round robin (RR) algorithm with time quantum = 1 Time 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 (head) (head) Part B: What is the waiting time of each process for each of the above scheduling algorithms? What is the average waiting time? Average SJF Wait time RR (q=1) Part C: What is the turnaround time of each process for each of the above scheduling algorithms? What is the average turnaround time? Average SJF Turnaround time RR (q=1)

Question 2 Consider two user processes and in a uniprocessor system. has two threads. has three threads. The CPU burst times for the threads are shown in the table below: Thread CPU burst time T11 T12 1 3 T21 T22 T23 3 2 1 In the following questions, assume the context switch time to be zero. a)suppose the one-to-one model is being used to map the user threads to the kernel threads. The scheduling algorithm being used by the kernel is Round Robin with time quantum = 1 ms. The ready queue at time 0 is as follows: T22 T11 T23 T12 T21 where T21 is at the head of the queue. Draw a Gantt chart that illustrates the execution of these threads. Time 0 1 2 3 4 5 6 7 8 9 b)suppose the threads are implemented entirely at the user level. A many-to-one model is used for mapping the user threads to the underlying kernel thread for the process. The scheduling algorithm used for the kernel threads is Round Robin with a time quantum of 2 ms.the scheduling algorithm for the user threads is Round Robin with a time quantum of 1 ms. Suppose the processes are moved to the ready state in the following order: and In:T11andT12 In:T21andT22andT23 Draw a Gantt chart that illustrates the execution of these threads. Time 0 1 2 3 4 5 6 7 8 9