Computer Science 162 - Spring 2000 - Franklin - Midterm 2

Computer Science 162 - Spring 2000 - Franklin - Midterm 2 -...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
CS 162, Midterm #2, Spring 2000, SOLUTIONS CS 162, Spring 2000 (April 10, 2000) SOLUTIONS Midterm #2 Prof. Michael J. Franklin General Information: This is a closed book examination. You have 1 hour and 20 minutes to answer as many questions as possible. Partial credit will be given. There are 100 points in all. You should read all of the questions before starting the exam, as some of the questions are substantially more time-consuming than others. Write all of your answers directly on this paper. Be sure to clearly indicate your final answer for each question. Also, be sure to state any assumptions that you are making in your answers. Please try to be as concise as possible . Problem Possible Score 1. CPU Scheduling (5 parts) 20 20 2. Demand Paging (6 parts) 30 30 3. Caching (3 parts) 20 20 4. Address Translation (3 parts) 20 20 5. Disk Management (2 parts) 10 10 TOTAL 100 101 (can't add) Problem #1 [5 parts, 20 points total]: CPU Scheduling a) (4 points) Assume that 3 processes all with requirements of 1 second of CPU time each and no I/O arrive at the same time. What will be the average response time (i.e., average time to completion) for the processes under FIFO scheduling? ANSWER: 2 seconds, no partial credit b) (4 points) Answer part "a" for Round Robin (RR) scheduling assuming a timeslice of 0.1 sec and no overhead for context switches (i.e., context switches are free). ANSWER: 2.9 seconds, no partial credit c) (4 points) Answer part "a" for Shortest Job Finish (SJF) scheduling. file:///C|/Documents%20and%20Settings/Jason%20Rafte. ..0Spring%202000%20-%20Franklin%20-%20Midterm%202.htm (1 of 8)1/27/2007 4:02:23 PM
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
CS 162, Midterm #2, Spring 2000, SOLUTIONS ANSWER: 2 seconds, no partial credit d) (4 points) Multilevel Feedback Queue Scheduling (MFQS) is a fairly good, general CPU scheduling algorithm, but as initially described in class, can lead to starvation under certain circumstances. Briefly describe how starvation can occur using MFQS and how to modify MFQS so that starvation can be avoided. ANSWER: Long jobs on low-priority queues can starve if a continuous stream of short jobs keep the high-priority queues full. Soln: hold a lottery among the QUEUES, weighted in favor of short queues OR implement aging, so that jobs that remain on low-priority queues for a long time are promoted. 2 pts for starvation explanation 2 pts for correct solution e) (4 points) What advantage is there in having different time-quantum (i.e. timeslice) sizes on different levels of the MFQS approach? ANSWER: 1) different time quanta help differentiate between long and short jobs 2) for long jobs, short quanta mean unnecessary context switches (so different time quanta improve throughput) 3) Introduces more fairness The first two answers received full credit. Fairness received 2 points
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 05/17/2009 for the course CS 162 taught by Professor Kubiatowicz during the Spring '02 term at Berkeley.

Page1 / 8

Computer Science 162 - Spring 2000 - Franklin - Midterm 2 -...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online