# aa3 - misses on a cache of size i on algorithm A(For a...

This preview shows pages 1–2. Sign up to view the full content.

Problem Set 3 Due: March 28 cs2me3 Winter 2007 Instructions 1. You are encouraged to work in groups of two. If you cannot ﬁnd a partner, you can work alone. 2. Please submit one copy of the assignment; if you are working with a partner, both names should appear on the assignment. 3. For Part A of the assignment, you must submit an electronic copy of your Java appli- cation via WebCT (by the time of the lecture on the due date of the assignment). Part A Write a program which does the following experiment: on input m, n, k it creates a random list of m requests, where each request is from among [ n ] = { 1 , 2 , . . . , n } pages of memory, and it counts the number of misses on a cache of size i k of each of the following page replacement algorithms: LRU, CLOCK, FIFO, LIFO, LFU, LFD 1 , and plots the result. In other words, for each 0 < i k it draws a point in position ( i, misses A ( i )), the number of

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

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: misses on a cache of size i on algorithm A . (For a better visual eﬀect, plot the outcome of each algorithm in a diﬀerent color, and provide a legend.) 1 See page 43 of the notes for the description of these algorithms. 1 Part B 1. For a general i , provide a sequence of page requests that illustrates Belady’s Anomaly incurred by FIFO on cache sizes i and i + 1. In your analysis, assume that the cache is initially empty. 2. Show that FWF is a marking algorithm, and that FIFO is not a marking algorithm. 3. We say that a page replacement algorithm ALG is conservative if it satisﬁes the fol-lowing condition: On any consecutive input subsequence containing k or fewer distinct page requests, ALG will incur k or fewer page faults. Prove that LRU and FIFO are conservative, but FWF is not. 2...
View Full Document

## This note was uploaded on 02/10/2009 for the course RLG 100 taught by Professor Pearly during the Spring '08 term at University of Toronto.

### Page1 / 2

aa3 - misses on a cache of size i on algorithm A(For a...

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

View Full Document
Ask a homework question - tutors are online