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

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

Practice Exercises 305

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

CPU Scheduling Algorithms

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

Properties of Processes

Chapter 6: CPU Scheduling

Chapter 5 CPU scheduling

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

Chapter 5: CPU Scheduling

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

COSC243 Part 2: Operating Systems

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

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

CS307: Operating Systems

Chapter 5: CPU Scheduling

CHAPTER 2: PROCESS MANAGEMENT

Chapter 5: CPU Scheduling

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

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

CS370 Operating Systems

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

Chapter 5: Process Scheduling

Operating System Concepts Ch. 5: Scheduling

LECTURE 3:CPU SCHEDULING

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

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

CS370 Operating Systems

CS370 Operating Systems

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

CPU Scheduling: Objectives

Operating Systems CS 323 Ms. Ines Abbes

Course Syllabus. Operating Systems

Homework Assignment #5

Processes. CS 475, Spring 2018 Concurrent & Distributed Systems

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

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

Chapter 6: CPU Scheduling

CS370 Operating Systems

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

TDIU25: Operating Systems II. Processes, Threads and Scheduling

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

Ch 4 : CPU scheduling

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

Lecture 2 Process Management

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

FCM 710: Architecture of Secure Operating Systems

FCM 710: Architecture of Secure Operating Systems

Job Scheduling. CS170 Fall 2018

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

Operating Systems CMPSCI 377 Spring Mark Corner University of Massachusetts Amherst

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

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

Chap 7, 8: Scheduling. Dongkun Shin, SKKU

Chapter 5 Process Scheduling

Scheduling of processes

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

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

CS3733: Operating Systems

1.1 CPU I/O Burst Cycle

Uniprocessor Scheduling. Aim of Scheduling

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

CSE 4/521 Introduction to Operating Systems

Operating Systems ECE344. Ding Yuan

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

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

OPERATING SYSTEMS CS3502 Spring Processor Scheduling. Chapter 5

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

Start of Lecture: February 10, Chapter 6: Scheduling

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

Last Class: Processes

Chapter 5: Process Scheduling

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.

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

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

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

by Maria Lima Term Paper for Professor Barrymore Warren Mercy College Division of Mathematics and Computer Information Science

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

Processes and Threads

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

CPU Scheduling. The scheduling problem: When do we make decision? - Have K jobs ready to run - Have N 1 CPUs - Which jobs to assign to which CPU(s)

Scheduling. Today. Next Time Process interaction & communication

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

ECE 7650 Scalable and Secure Internet Services and Architecture ---- A Systems Perspective. Part I: Operating system overview: Processes and threads

Supplementary Materials on Multilevel Feedback Queue

MC7204 OPERATING SYSTEMS

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

Operating Systems. Scheduling

Chapter 9. Uniprocessor Scheduling

Advanced Operating Systems (CS 202) Scheduling (1)

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 6: CPU Scheduling. Operating System Concepts 9 th Edition

CSE 120 Principles of Operating Systems Spring 2017

Chapter 6: CPU Scheduling

Operating Systems. Figure: Process States. 1 P a g e

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

Chapter 6: CPU Scheduling

4.8 Summary. Practice Exercises

CS630 Operating System Design, First Exam, Spring 2017,

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

Transcription:

Assignment 3 (Due date: Thursday, 10/15/2009, in class) Your name: Date: Part One: Provide brief answers to the following Chapter Exercises questions: 4.7 Provide two programming examples in which multithreading does not provide better performance than a single-threaded solution 4.10 Which of the following components of program state are shared across threads in a multithreaded process? a. Register values b. Heap memory c. Global variables d. Stack memory 4.12 As described in Section 4.5.2, Linux does not distinguish between processes and threads. Instead, Linux treats both in the same way, allowing a task to be more akin to a process or a thread depending on the set of flags passed to the clone() system call. However, many operating systems such as Windows XP and Solaris treat processes and threads differently. Typically, such systems use a notation wherein the data structure for a process contains pointers to the separate threads belonging to the process. Contrast these two approaches for modeling processes and threads within the kernel. 4.14 Consider a multiprocessor system and a multithreaded program written using the many-to-many threading model. Let the number of user-level threads in the program be greater than the number of processors in the system. Discuss the performance implications of the following scenarios. a. The number of kernel threads allocated to the program is less than the number of processors. b. The number of kernel threads allocated to the program is equal to the number of processors. c. The number of kernel threads allocated to the program is greater than the number of processors but less than the number of user-level threads. 1

5.9 Why is it important for the scheduler to distinguish I/O-bound programs from CPUbound programs? 5.11 Consider the exponential average formula used to predict the length of the next CPU burst. What are the implications of assigning the following values to the parameters used by the algorithm? a. α = 0 and τ 0 = 100 milliseconds b. α = 0.99 and τ 0 = 10 milliseconds 5.12 Consider the following set of processes, with the length of the CPU-burst time given in milliseconds: Process Burst Time Priority P1 10 3 P2 1 1 P3 2 3 P4 1 4 P5 5 2 The processes are assumed to have arrived in the order P1, P2, P3, P4, P5, all at time 0. a. Draw (Hand drawing OK) four Gantt charts illustrating the execution of these processes using FCFS, SJF, a nonpreemptive priority (a smaller priority number implies a higher priority), and RR (quantum = 1) scheduling. b. (Using a Table) what is the turnaround time of each process for each of the scheduling algorithms in part a? c. (Using a Table) what is the waiting time of each process for each of the scheduling algorithms in part a? d. Which of the schedules in part a results in the minimal average waiting time (over all processes)? 5.13 Which of the following scheduling algorithms could result in starvation? a. First-come, first-served b. Shortest job first c. Round robin d. Priority 5.15 Consider a system running ten I/O-bound tasks and one CPU-bound task. Assume that the I/O-bound tasks issue an I/O operation once for every millisecond of CPU computing and that each I/O operation takes 10 milliseconds to complete. Also assume that the context switching overhead is 0.1 millisecond and that all processes are longrunning tasks. What is the CPU utilization for a round-robin scheduler when: a. The time quantum is 1 millisecond b. The time quantum is 10 milliseconds 2

5.18 Explain the differences in the degree to which the following scheduling algorithms discriminate in favor of short processes: a. FCFS b. RR c. Multilevel feedback queues 5.19 Using the Windows XP scheduling algorithm, what is the numeric priority of a thread for the following scenarios? a. A thread in the REALTIME PRIORITY CLASS with a relative priority of HIGHEST. b. A thread in the NORMAL PRIORITY CLASS with a relative priority of NORMAL. c. A thread in the HIGH PRIORITY CLASS with a relative priority of ABOVE NORMAL. 5.20 Consider the scheduling algorithm in the Solaris operating system for time-sharing threads: a. What is the time quantum (in milliseconds) for a thread with priority 10? With priority 55? b. Assume a thread with priority 35 has used its entire time quantum without blocking. What new priority will the scheduler assign this thread? c. Assume a thread with priority 35 blocks for I/O before its time quantum has expired. What new priority will the scheduler assign this thread? 5.21 The traditional UNIX scheduler enforces an inverse relationship between priority numbers and priorities: The higher the number, the lower the priority. The scheduler recalculates process priorities once per second using the following function: Priority = (Recent CPU usage / 2) + base where base = 60 and recent CPU usage refers to a value indicating how often a process has used the CPU since priorities were last recalculated. Assume that recent CPU usage for process P1 is 40, process P2 is 18, and process P3 is 10. What will be the new priorities for these three processes when priorities are recalculated? Based on this information, does the traditional UNIX scheduler raise or lower the relative priority of a CPU-bound process? 3

599a. The program shown in the following uses the Pthreads API. What would be output 4

599b. The program shown in the following uses the Pthreads API. What would be output 5

599c. The program shown in the following uses the Pthreads API. What would be output 6

599d. The program shown in the following uses the Pthreads API. What would be output 7

599e. The program shown in the following uses the Pthreads API. What would be output 8

599f. The program shown in the following uses the Pthreads API. What would be output 9

599h. The program shown in the following uses the Pthreads API. What would be output 10

599i. The program shown in the following uses the Pthreads API. What would be output 11

Part Two: Important questions related to Chapters 4 & 5 (No submission): o 4.1, 4.2, 4.3, 4.4 o 5.1, 5.2, 5.3, 5.4, 5.5, 5.6, 5.7 o (check the course website for these questions and solutions) ========================Important Notes=========================== Solutions must be typewritten. You can use lists, bullets for the write-up (short phrases are OK; complete sentences not necessary). Put all your solutions in the same order as the above questions. Use this question paper as cover page and staple them together. Electronic submissions will be accepted only under an excusable circumstances (the above rules still apply) in this case, put your solutions including this question paper as cover page into ONE SINGLE Word or PDF file and send it to me via email. I ll grade your work based on this file and send back only your grade (without corrections of your errors). The full score for this homework is 100 points. You will lose 5-10 points for missing ANY ONE of the followings in your submission: o No name o No cover page o Your work submitted not in proper order o Not a single Word or PDF file (if submitted via email) ============================================================== 12