{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

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 C H A P T E R 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 verifies 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 the free frame. Upon completion of 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 Document Right 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 five-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. FIFO replacement c. Optimal replacement d. Second-chance replacement Answer: Rank Algorithm Suffer from Belady’s anomaly 1 Optimal no 2 LRU no 3 Second-chance yes 4 FIFO yes 9.5 When virtual memory is implemented in a computing system, there are certain costs associated with the technique and certain benefits. List the costs and the benefits. Is it possible for the costs to exceed the benefits?
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.

{[ snackBarMessage ]}