CS636-2006S-MID
Midterm
March 23, 2006
Name (Last, First):
This exam consists of 5 questions on 7 pages; be sure you have the entire exam before starting. The point value of each question is indicated at its beginning; the entire exam is worth 100 points. Individual parts of a multi-part question are generally assigned approximately the same point value: exceptions are noted. This exam is open text and notes. However, you may NOT share material with another student during the exam. Be concise and clearly indicate your answer. Presentation and simplicity of your answers may affect your grade. Answer each question in the space following the question. If you find it necessary to continue an answer elsewhere, clearly indicate the location of its continuation and label its continuation with the question number and subpart if appropriate. You should read through all the questions first, then pace yourself. The questions begin on the next page. Problem 1 2 3 4 5 Total
Possible 20 20 20 20 20 100
1
Score
CS636-2006S-MID 1. (
Midterm
March 23, 2006
/20 points )
Concurrency and synchronization (10 points) For the parallel versions of your wfreq program, why is it important to have each thread update a separate hash table rather than a single, shared hash table that keeps track of the word counts?
(10 points) What makes the parallel versions of wfreq more complicated than the sequential version?
2
CS636-2006S-MID 2. (
Midterm
March 23, 2006
/20 points )
Eraser as a library Recall the paper “Eraser: A Dynamic Data Race Detector for Multithreaded Programs”. This paper explains that Eraser uses binary rewriting to instrument a multithreaded C program. The advantage of this approach is that the programmer does not have to change his or her source code. The disadvantage is that binary rewriting is not portable and possibly does more work than necessary. Describe how you would implement Eraser-like functionality by requiring the C programmer to make source code modifications. Explain what is required by the C programmer and how you maintain the locksets for each shared variable. Please give a high-level description and some C code snippets that illustrates your approach.
3
CS636-2006S-MID 3. (
Midterm
March 23, 2006
/20 points )
Virtual Machines and Virtual Memory (10 points) Explain the difference between full virtualization and paravirtualization. Discuss the advantages and disadvantages of each approach to virtualization. Give examples from Xen, VMware, and Denali.
(10 points) Explain how Xen and VMware differ when in comes to managing paged virtual memory. That is, a CPU can only have one “real” page table. How do Xen and VMware make sure that VMs can update the real page table in a safe manner. How do they manage the TLB?
4
CS636-2006S-MID 4. (
Midterm
March 23, 2006
/20 points )
Content-based page sharing in VMWare ESX Recall from the paper, “Memory Resource Management in VMWare ESX Server” by Carl Waldspurger that VMware ESX implements content-based page sharing to reduce the overall memory usage of multiple virtual machines running on a single host machine. Using a hash function, content-based sharing identifies pages with identical data used in two or more virtual machines. However, the paper does not mention how much page duplication is identified, if any, within a single virtual machine. Do you think the ESX content-based page sharing algorithm will find duplicate pages within a single VM? Explain your answer. Also, explain why there might be duplication within a single VM.
5
CS636-2006S-MID 5. (
Midterm
March 23, 2006
/20 points )
Emulation and Interpreters (10 points) When QEMU is emulating an x86 processor on an x86 host, why must it still perform dynamic translation? That is, why can’t it just copy the x86 instructions directly into the translation cache?
(10 points) Given what you now know about interpreters, why do you think the Python version of wfreq is slower than the C version? Give specific examples.
6
CS636-2006S-MID
Midterm Continue your answers here if necessary.
7
March 23, 2006