CS 378: Information Systems

Spring 1999

Assignment 2

Frame Replacement and Page Management

Due Tuesday February 16

For this assignment, you will be working with a program that manages a buffer pool and data pages for storing records. The goal is to gain an understanding how frame replacement policies affect the number of I/O operations and to gain some experience working with code that links pages of directory information.

The files for this project are located in ~miller/cs378/hw2. The classes are documented and we will go over their functionality in class. The program Driver.cpp provides a simple demonstration of reading a file, loading its records into a database, and sequentially writing out each of the records. The Makefile compiles all of the classes and links the driver code to produce the executable program db.

Experimenting with a simple replacement strategy

The Buffer class uses a simple page replacement policy that circularly scans through the pool looking for a frame with a zero pin count. It replaces the page in this frame. The next scan will then start looking at the frame after this one. You may note that this policy approximates a FIFO strategy.

Locate the code that replaces a page and insert a write statement that indicates that a page is being replaced. Also add code that keeps a count of replacements. Using different pool sizes, run the driver program loading and writing the movies file. Record the number of replacements with each size.

Implementing the clock strategy to approximate the LRU policy.

By declaring and using a reference bit for each frame, the current replacement policy can be modified to produce the clock replacement policy (as described in class and in the text). Modify the policy in this way and rerun your experiments with the new clock strategy. Write a paragraph summary of your results.

Extending the free-page bit map

As will be explained in class, the current implementation uses the header page to maintain a bit map that indiciates which pages are available. However this strategy is limited by the size of the header page. Because page usage is redundant with the directory pages, we can build and maintain an efficient bit-map memory derived from the directory pages. Your task is to declare this bit-map in memory, automatically set it from the directory pages whenever a page manager is constructed, and use it to efficiently find free pages.

Submission

Please turn in hardcopies of the following: