9-sol - CHAPTER Virtual Memory 9 Practice Exercises 9.1...

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

View Full Document Right Arrow Icon
9 CHAPTER Virtual Memory Practice Exercises 9.1 Under what circumstances do page faults occur? Describe the actions taken by the operating system when a page fault occurs. Answer: A page fault occurs when an access to a page that has not been brought into main memory takes place. The operating system veriFes the memory access, aborting the program if it is invalid. If it is valid, a free frame is located and I/O is requested to read the needed page into thefreeframe.Uponcompletionof I/O, the process table and page table are updated and the instruction is restarted. 9.2 Assume that you have a page-reference string for a process with m frames (initially all empty). The page-reference string has length p ; n distinct page numbers occur in it. Answer these questions for any page- replacement algorithms: a. What is a lower bound on the number of page faults? b. What is an upper bound on the number of page faults? Answer: a. n b. p 9.3 Which of the following programming techniques and structures are good for a demand-paged environment ? Which are not good ?Ex- plain your answers. a. Stack b. Hashed symbol table 29
Background image of page 1

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

View Full DocumentRight Arrow Icon
30 Chapter 9 Virtual Memory c. Sequential search d. Binary search e. Pure code f. Vector operations g. Indirection Answer: a. Stack—good. b. Hashed symbol table—not good. c. Sequential search—good. d. Binary search—not good. e. Pure code—good. f. Vector operations—good. g. Indirection—not good. 9.4 Consider the following page-replacement algorithms. Rank these al- gorithms on a Fve-point scale from bad to perfect according to their page-fault rate. Separate those algorithms that suffer from Belady’s anomaly from those that do not. a. LRU replacement b. ±I±O replacement c. Optimal replacement d. Second-chance replacement Answer: Rank Algorithm Suffer from Belady’s anomaly 1O p t i m a l n o 2 LRU no 3 Second-chance yes 4 ±I±O yes 9.5 When virtual memory is implemented in a computing system, there are certain costs associated with the technique and certain beneFts. List the costs and the beneFts. Is it possible for the costs to exceed the beneFts?
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 11/03/2009 for the course IT OS taught by Professor Dr.stephan during the Winter '09 term at Abu Dhabi University.

Page1 / 6

9-sol - CHAPTER Virtual Memory 9 Practice Exercises 9.1...

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

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