Design a memory buffer of limited size, Computer Engineering

Extend task 1 so that it now supports a memory buffer of limited size. Provide the same functionality as task 1 except now make the server work with a limited buffer size.

Like task 1, the server is the only thread that can access the buffer directly.

1. Allow user to specify a 2nd command line argument which specifies the buffer size in terms of the number of pages. Let that number be B.

2. The server reads the first B pages from the init_buffer_pages.dat file into the buffer. It then copies all the pages into a store file. You can organize the store file anyway you want as long as it stores all pages including those not in memory. I recommend that you use a binary file to do this since that allows you to do random seeks on the file. Assume all pages have a fixed size of 4096 characters.

3. When a page request for a non-buffer resident page occurs one page that is currently in the buffer must be evicted from memory to make room for the newly requested page to be loaded from the store file. The page replacement policy you need to implement is the least recently used (LRU) policy. Please read page 489 of the textbook for an explanation of the LRU policy.

4. Once a page to be evicted has been chosen then the program must decide whether it should be flushed to the store file or discarded.
a) If the page has been dirtied (modified) since its last load from disk then it should be flush to the store file on disk.
b) Otherwise it should be discarded without flushing to the store file.

5 The server needs to keep a log of the sequence of page evictions (pages either discarded or flushed to disk) in a log file called "server_log.dat". The entries in the log file are in the order that they were evicted. Looking at this file I will be able to tell if you have implemented the LRU page-replacement policy correctly.

The server_log.dat file should be in the following format:


...
...

For example:

20 abscde
10 KJlkljf
29 jjkjkKKH

Posted Date: 3/16/2013 3:37:18 AM | Location : United States







Related Discussions:- Design a memory buffer of limited size, Assignment Help, Ask Question on Design a memory buffer of limited size, Get Answer, Expert's Help, Design a memory buffer of limited size Discussions

Write discussion on Design a memory buffer of limited size
Your posts are moderated
Related Questions
Give the solutions for critical section problem? A solution to the critical section problem must specify the subsequent requirements. (a) Mutual exclusion (b) Progress (c)

With a neat diagram explain operation of time multiplexed space switching. Time division switches, an inlet or an outlet corresponded to a particular subscriber line with one s

What are the features of ADO.Net ?  ADO.NET features: 1. Disconnected Data Architecture 2. Data cached in Datasets 3. Data transfer in XML format 4. Interaction wit

Q. Explain Processing of an Interrupt? The interrupt is processed as: Step 1: Number field in INT instruction is multiplied by 4 to get its entry in interrupt vector table.

Magento supports installation of modules by a web-based interface accessible by the administration area of a Magento installation. Modules are hosted on the Magento eCommerce websi

A certain car has suspension modes which are uncoupled front to back.  When a person with a mass of 60 kg sits in the rear of a car, in the centre of the seat which is directly ove

What is meant by Questionnaires This includes sending out questionnaires to the work force or/and to customers to find out their views of existing system and to find out how.

Question 1 What are the drivers behind the convergence between voice and data networks? Explain them briefly Question 2 Explain the need and functioning of Private ST Netw

Mutability and Accessibility of primary memory: Mutability: Read/write storage or mutable storage  It provides permit ion for the information to be overwritten at

What is Matrix Addressing Mode. Ans. Matrix Addressing Mode: The arrangement which needs the fewest address lines is a square array of n rows and n columns for a whole memory