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

Similar documents
CHAPTER 2: PROCESS MANAGEMENT

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

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

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

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

CS630 Operating System Design, First Exam, Spring 2017,

CMPT 300: Operating Systems I Assignment 1

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

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

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

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

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

CS370 Operating Systems

Chapter 5 CPU scheduling

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

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

Lecture 2 Process Management

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

Operating Systems. Engr. Abdul-Rahman Mahmood MS, PMP, MCP, QMR(ISO9001:2000) alphapeeler.sf.net/pubkeys/pkey.htm

CS Mid term Exam Maximum points 100; Maximum time allowed: 75 minutes

Chapter 6: CPU Scheduling

University of Ottawa School of Information Technology and Engineering

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

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

Processes and Threads

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

* What are the different states for a task in an OS?

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

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

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

Homework Assignment #5

Job Scheduling. CS170 Fall 2018

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

Operating Systems Design Fall 2010 Exam 1 Review. Paul Krzyzanowski

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

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

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

York University Lassonde School of Engineering Department of Electrical Engineering and Computer Science

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

Chapter 5: CPU Scheduling

CSE 4/521 Introduction to Operating Systems

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

Chapter 5: CPU Scheduling

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

Chapter 5: Process Scheduling

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

OPERATING SYSTEMS CS3502 Spring Processor Scheduling. Chapter 5

CS307: Operating Systems

CMPSCI 377: Operating Systems Exam 1: Processes, Threads, CPU Scheduling and Synchronization. October 9, 2002

CS370 Operating Systems

8: Scheduling. Scheduling. Mark Handley

FCM 710: Architecture of Secure Operating Systems

CPU Scheduling Algorithms

TDIU25: Operating Systems II. Processes, Threads and Scheduling

CS370 Operating Systems

Processes. CS 475, Spring 2018 Concurrent & Distributed Systems

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

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

Chapter 5: CPU Scheduling

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

CS3733: Operating Systems

UNIT 3. PROCESS MANAGEMENT

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

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

Operating Systems. Lecture 05

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

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

Properties of Processes

Q1. State True/false with jusification if the answer is false:

CS370 Operating Systems Midterm Review

Scheduling. Today. Next Time Process interaction & communication

Unit 3 : Process Management

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

Process Concept Process in Memory Process State new running waiting ready terminated Diagram of Process State

Scheduling of processes

FCM 710: Architecture of Secure 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)

Operating Systems (1DT020 & 1TT802)

Reminder. Exam QuesVon 1a. 1 st Midterm Exam Thursday February 18, 9.30am, in class Keep seat open between you and neighbor!

SMD149 - Operating Systems

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

Operating System Concepts Ch. 5: Scheduling

Processes. Overview. Processes. Process Creation. Process Creation fork() Processes. CPU scheduling. Pål Halvorsen 21/9-2005

CPU Scheduling: Objectives

SAMPLE MIDTERM QUESTIONS

CS 322 Operating Systems Practice Midterm Questions

UNIT - II PROCESS MANAGEMENT

Operating Systems CS 323 Ms. Ines Abbes

OPERATING SYSTEMS: Lesson 4: Process Scheduling

1.1 CPU I/O Burst Cycle

NAME: KEY (FIRST NAME FIRST) TOTAL:

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

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

Processes and Threads

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

QUESTION BANK UNIT I

Operating Systems ECE344. Ding Yuan

Transcription:

CSC 716 Advanced Operating System Fall 2007 Exam 1 Answer all the questions. The maximum credit for each question is as shown. 1. (15) Multiple Choice(3 points for each): 1) Which of the following statement is true for DMA: D A. In DMA, Processor checks status until operation is complete B. In DMA, Processor is interrupt when I/O module ready to exchange data C. In DMA, no interrupt is produced. D. In DMA, interrupt is sent when the task is complete.. 2) Which of the following is volatile memory? A A. Main memory B. CD/DVD C. Hard disk D. Flash memory 3) Which of the following is not control and status register? E A. Processor Status Word (PSW) B. Memory Address Register (MAR) C. Program Controller (PC) D. Instruction Register (IR) 4) The earliest OS is A A. monolithic B. modular C. Microkernel D. Modules 5) One process is waiting for the input from the user, which state is this process most probably in? C A. Ready B. Running C. Waiting D. New E. Terminated 2. (18) For each of the following statements indicate whether it is true or false, and give a one-sentence justification (3 points for each). a. A process is a program. A process is a program in execution.

b. Suspending a process involves suspending all threads of the process since all threads share the same address space. True Suspending a process is to swap this process to disk to free up more memory. Since resources belong to the process, so if the process is suspended, all threads of the process will be suspended. c. In a multithreaded environment, the unit of resource ownership and scheduling/execution is thread. In a multithreaded environment, the unit of resource ownership is process, the unit of scheduling/execution is thread. d. If one thread in a process is blocked, this prevents other threads in the process even if that other thread is in a ready state. Depends on whether OS is involved when the thread is blocked. If OS is involved, then answer is yes. e. Each thread of one process has to maintain a separate program counter, stack, and registers. True Thread control block contains a separate program counter, stack, and registers. These are necessary to keep the execution of the thread. f. Round-robin scheduling never results in more context switches than FCFS. It depends on the quantum. If every job has an execution time less than the quantum, then it has the same number as FCFS. 3. (10) Briefly describe one advantage and one disadvantage of kernel-level threads. Advantages: The kernel can schedule another thread when if one thread performs a blocking system call, e.g., to do I/O. Multiprocessing is easier because the kernel can directly schedule threads. Disadvantage: More Overhead The kernel is unaware of the user-level application parallelism. Even if multiple processors are given, the kernel may not fully utilize them.

The kernel should be modified to support different thread package. 4. (12) What are the difference between interrupts and exceptions? Give two examples of each. Interrupts are asynchronous events external the CPU (e.g., timer interrupt, device interrupt). Exceptions are synchronous events that occur as the result of executing instructions (e.g., divide by zero, system call). 5. (15) Explain what will be output for the following program? #include <sys/types.h> #include <stdio.h> #include <unistd.h> int value = 5; int main() { pid_t pid; pid=fork(); if(pid==0){ printf("i am the child process. \n"); value+=15; else if (pid > 0) { wait (NULL); printf("i am the parent process, value=%d ", value); exit(0); I am the child process. I am the parent process, value=5 6. (30) Consider the following set of processes, with the length of the CPU burst given in milliseconds: Process Burst Times Priority 10 3 P2 1 1 P3 2 3 P4 1 4 5 2

The processes are assumed to have arrived in the order, P2, P3, P4,, all at time 0. a. (15) Draw five Gantt charts that illustrate the execution of these processes using the following scheduling algorithms: FCFS, SJF, nonpreemptive priority (a small priority number implies a higher priority), RR(quantum=1) and Highest Response Ratio Next(HRRN). b. (15) What is the turnaround time and normalized turn around time of each process for each of the scheduling algorithms in part a? a. The five Gantt charts are FCFS: P2 P3 P4 SJF: P2 P4 P3 Priority: P2 P3 P4 RR: P2 P3 P4 P3 Highest Response Ratio Next: P3 P2 P4 b. Turnaround time: FCFS RR SJF Priority HRRN 10 19 19 16 10 P2 11 2 1 1 15 P3 13 7 4 18 17 P4 14 4 2 19 18 19 14 9 6 19 Normalized turnaround time (turnaround time/burst time):

FCFS RR SJF Priority HRRN 1 1.9 1.9 1.6 1 P2 11 2 1 1 3 P3 13/2 7/2 2 9 17/2 P4 14 4 2 19 18 19/5 14/5 9/5 6/5 19