Computer Science 162 - Spring 1998 - Smith - Midterm 1

Computer Science 162 - Spring 1998 - Smith - Midterm 1 - CS...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: CS 162, Midterm #1, Spring 1998 CS162, Spring 1998 Midterm #1 Professor Alan Smith Problem #1 Explain the difference between a process and a thread. Define both. What are the tradeoffs between using one and using the other? (14) Problem #2 We discussed two mathematical quantities that are reasonable targets for optimization in scheduling: minimizing ave(f(i)) and minimizing ave(f(i)/s(i)). Please explain what each is, and explain why we would like to minimize it. (14) Problem #3 Please provide code (of the same sort used in class) that will implement P & V using the "swap" operation described in class. (18) Problem #4 What is the difference between an interrupt and a trap? Define both. Please give at least two examples of each. (12) Problem #5 Why does rollback usually require checkpoints? Please define both terms and explain. (11) Problem #6 file:///C|/Documents%20and%20Settings/Jason%20Raft...%20Spring%201998%20-%20Smith%20-%20Midterm%201.htm (1 of 2)1/27/2007 4:01:44 PM CS 162, Midterm #1, Spring 1998 For each of FIFO, SRPT, and RR (Q=.25), and for the following set of arrival and service times, please show a time line for which process is executing, and compute the mean flow time. Show your computations. (We might give partial credit, if you made a simple and obvious error; we're not going to try to decode your calculations if they aren't obvious.) (15) arrival service A 0 B .3 C 1.1 1.5 .8 1.1 Problem #7 For the following two cases, please either show a complete safe sequence or show that there isn't one. (16) PROCESS has-X has-Y max needs-X max needs-Y A B C D 10 0 30 50 20 70 10 80 75 50 60 100 50 90 40 220 a. available: X: 40 Y: 40 b. available: X: 40 Y: 35 Posted by HKN (Electrical Engineering and Computer Science Honor Society) University of California at Berkeley If you have any questions about these online exams please contact http://hkn.eecs.berkeley.edu/student/online/cs/162/1998/<mailto:examfile@hkn. eecs.berkeley.edu>MAILTO:examfile@hkn.eecs.berkeley.edu file:///C|/Documents%20and%20Settings/Jason%20Raft...%20Spring%201998%20-%20Smith%20-%20Midterm%201.htm (2 of 2)1/27/2007 4:01:44 PM ...
View Full Document

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

Ask a homework question - tutors are online