MidtermExamSp11-Solutions

MidtermExamSp11-Solutions - Student Name: _ SID: _...

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

View Full Document Right Arrow Icon
CS 162 Midterm Page 1 March 9, 2011; 4:00-5:30 PM University of California at Berkeley College of Engineering Department of Electrical Engineering and Computer Science CS 162 I. Stoica Spring 2011 FIRST MIDTERM EXAMINATION Wednesday, March 9, 2011 INSTRUCTIONS—READ THEM NOW! This examination is CLOSED BOOK/CLOSED NOTES. There is no need for calculations, and so you will not require a calculator, Palm Pilot, laptop computer, or other calculation aid. Please put them away. You MAY use one 8.5” by 11” double-sided crib sheet, as densely packed with notes, formulas, and diagrams as you wish. The examination has been designed for 80 minutes/80 points (1 point = 1 minute, so pace yourself accordingly). All work should be done on the attached pages. In general, if something is unclear, write down your assumptions as part of your answer. If your assumptions are reasonable, we will endeavor to grade the question based on them. If necessary, of course, you may raise your hand, and a TA or the instructor will come to you. Please try not to disturb the students taking the examination around you. We will post solutions to the examination as soon as possible, and will grade the examination as soon as practical, usually within a week. Requests for regrades should be submitted IN WRITING, explaining why you believe your answer was incorrectly graded, within ONE WEEK of the return of the examination in class. We try to be fair, and do realize that mistakes can be made during the regarding process. However, we are not sympathetic to arguments of the form “I got half the problem right, why did I get a quarter of the points?” __________________________________________ SID: _______________________________ (Signature) __________________________________________ Discussion Section (Day/Time): ________ (Name—Please Print!) QUESTION POINTS ASSIGNED POINTS OBTAINED 1 10 2 15 3 15 4 20 5 20 6 20 TOTAL 100
Background image of page 1

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

View Full DocumentRight Arrow Icon
Student Name: _____________________________________ SID: _____________________ CS 162 Midterm Page 2 March 9, 2011; 4:00-5:30 PM Question 1. Miscellaneous (10 points) For each of the following statements, indicate whether the statement is True or False, and provide a very short explanation of your selection (2 points each). a. Several threads can share the same address space. T F Rationale: Yes, two threads in the same process will share the process’ address space. b. Changing the order of semaphores’ operations in a program does not matter. T F Rationale: If a semaphore is initialized to 0 you have to call first a P(); you cannot start with V(). For another example in which you cannot change the order of semaphores see Lec5.13. c. Paging leads to external fragmentation. T F Rationale: All pages have the same size, so there is no external fragmentation. d. FIFO scheduling policy achieves lowest average response time for equal size jobs. T F Rationale: If all jobs have equal size, FIFO is equivalent with SRTF which is optimal discipline for minimizing the response time. e. LRU exhibits the Belady anomaly. T F Rationale: LRU guarantees that the subset of pages in a cache of size X is a subset of pages hold by a cache of size X+1 (see Lec11.24).
Background image of page 2
Student Name: _____________________________________ SID: _____________________ CS 162 Midterm Page 3 March 9, 2011; 4:00-5:30 PM Question 2. Deadlock (15 points) Consider a system with four processes P1, P2, P3, and P4, and two resources, R1, and R2, respectively.
Background image of page 3

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

View Full DocumentRight Arrow Icon
Image of page 4
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 9

MidtermExamSp11-Solutions - Student Name: _ SID: _...

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

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