


Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Main points of this exam paper are: Virtual Memory, Additional Credit, Circle the Questions, Most Comfortable, Producer Processes, System Interfaces, Performance and Protection
Typology: Exams
1 / 4
This page cannot be seen from the preview
Don't miss anything!



Attention: This exam has six questions. You should answer only five of them (there is no additional credit for answering all six questions). Circle the questions you wish to be counted towards you grade. As with any exam, you should read through the questions first and start with those that you are most comfortable with. If you believe that you cannot answer a question without making some assumptions, state those assumptions in your answer.
Consider a process that produces an integer value once every 50 msec and a consumer process that consumes an integer value every 100 msec. They communicate these values through a producer-consumer abstraction.
a. Give a producer-consumer implementation using semaphores. You can use pseudocode; it doesn't have to be an existing language like C or Java, but it should be understandable and have a structure somewhat like C (as compared to, say, ML). Your abstraction should have two procedures:
There should be n buffers, thereby allowing the producer to produce n more values than the consumer has currently consumed.
b. Given the rates that the consumer and producer processes run, what is an appropriate value of n? Explain.
c. Explain why you would expect your semaphore version of producer-consumer would be better than one that uses busy waiting.
Most file system interfaces provide open() and close() routines, in addition to standard read() and write() routines. Explain all the reasons you can think of for including open() and close() as part of the interface, rather than just having read() and write() routines which would take file names (rather than file descriptors), and any other information you think is relevant, as parameters. In particular, address issues of performance and protection.
Sally Surfer is designing a paged virtual memory system for a small computer she is building for a class project. She has decided that the virtual address space is 8 bits wide, and that there will be 8 pages in an address space. As her partner, she has asked you to implement the virtual memory system. Before writing any code, though, you decide to experiment with address translations in Sally's VM system to familiarize yourself with the system. You use the following simple single-level page table for the virtual address space of a process P as an example:
Virtual Page # Page Table Entry (PTE) 1 6 2 5 3 0 4 1 5 7 6 4 7 2
a. How many bytes can be addressed in the virtual address space?
b. What is the size of a page in bytes?
c. Which virtual page contains the virtual address 201?
d. What is the offset in the virtual page of the virtual address 201?
e. What is the physical page of the virtual address 201?
f. What is the physical address of the virtual address 201?
g. Which virtual page maps the physical address 201?
h. Sally also wants to support page sharing among virtual address spaces. Given a virtual address space for a second process Q , what would you do to Q' s page table so that P and Q share physical page 5?
i. What are the implications of setting process P 's page table entry 4 to the value 3?
j. An implicit assumption has been that the size of Sally's virtual address spaces is the same size as the physical memory of the computer that she is building. What are the implications of using Sally's virtual memory system for a physical memory that is smaller than her virtual address spaces? What about a physical memory that is larger? Briefly explain your answers.
The transmission control protocol (TCP) uses a sliding window protocol to control the amount of data outstanding end-to-end between the sender and receiver. In this question, we will explore a range of issues regarding the size of this window.
a. Explain how the size of the window affects the behavior of the connection. In particular, give at least two reasons why a sliding window is used.
b. The size of this window is initially set to be quite small, and increased in size by an algorithm called slow start. Explain what slow start is, why it is used, and how it affects the window size if there is no congestion in the network (that is, how will the window size change). Explain.
c. Consider a high speed network connection between a client and server in a workgroup. For example, a desktop machine connected to a server by a Gigabit Ethernet link. If the round trip time is small (~l ms), how will the window size change? Will slow start have a significant impact on the bandwidth achievable between the client and the server. Explain.
d. What if the connection were across the continental United States (RTT of 75ms), how will the window size change and will slow start have a significant impact on the bandwidth achievable between the client and the server.
e. What implications does the answer to (d) have for applications hoping to use high speed wide area networks?