Fa06 midterm 1-solutions - hUniversity of California,...

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

View Full Document Right Arrow Icon
Page 1/18 hUniversity of California, Berkeley College of Engineering Computer Science Division EECS Fall 2006 John Kubiatowicz Midterm I SOLUTIONS October 11 th , 2006 CS162: Operating Systems and Systems Programming Your Name: SID Number: Discussion Section: General Information: This is a closed book exam. You are allowed 1 page of hand-written notes (both sides). You have 3 hours to complete as much of the exam as possible. Make sure to read all of the questions first, as some of the questions are substantially more time consuming. Write all of your answers directly on this paper. Make your answers as concise as possible. On programming questions, we will be looking for performance as well as correctness, so think through your answers carefully. If there is something about the questions that you believe is open to interpretation, please ask us about it! Problem Possible Score 1 20 2 24 3 19 4 20 5 17 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
CS 162 Fall 2006 Midterm Exam I October 11, 2006 Page 2/18 [ This page left for π ] 3.141592653589793238462643383279502884197169399375105820974944
Background image of page 2
CS 162 Fall 2006 Midterm Exam I October 11, 2006 Page 3/18 Problem 1: Short Answer [20pts] Problem 1a[2pts]: What is a virtual machine? A virtual machine is a software emulation of an abstract machine. It can be used to present an idealized execution environment to software, prevent malicious software from compromising the underlying operating system, and permit multiple operating systems to run on a single hardware base simultaneously. Problem 1b[2pts]: Does a cyclic dependency always lead to deadlock? Why or why not? No. If there are multiple equivalent resources, then a cycle could exist that wasn’t a deadlock: The reason is that some thread that wasn’t a part of the cycle could release a resource needed by a thread in the cycle, thereby breaking the cycle. Problem 1c[2pts]: What are exceptions? Name two different types of exceptions and give an example of each type: Exceptions are events that stop normal execution, switch the execution mode into kernel mode, and begin execution at special locations within the kernel. Exceptions can be either synchronous or asynchronous. Examples of synchronous exceptions are system calls, divide by zero errors, illegal instructions, and page faults. Asynchronous exceptions are also called interrupts, such as timer interrupts, network interrupts, and disk interrupts. Problem 1d[2pts]: List two reasons why overuse of threads is bad (i.e. using too many threads for different tasks). Be explicit in your answers. Here are a few: Can significantly decrease throughput as the number of context switches increases. Significant space overhead from TCBs and other thread-related data structures. Dividing a problem into an increasing number of threads is very difficult and can
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 / 18

Fa06 midterm 1-solutions - hUniversity of California,...

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