Design a memory buffer of limited size, Computer Engineering

Assignment Help:

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


Related Discussions:- Design a memory buffer of limited size

The concept of process-parallel computing, The Concept of Process Infor...

The Concept of Process Informally, a method is a program in execution, behind the program has been loaded in the main memory. However, a method is more than just a program code

How to access the disk data, Q. How to Access the Disk Data? Disks oper...

Q. How to Access the Disk Data? Disks operate is semi-random mode of operation and generally referenced block wise. The data access time on a disk comprises two major component

Enumerate in detail about image scanners, Enumerate in detail about Image S...

Enumerate in detail about Image Scanners Drawings, graphs, colour and black-and-white photos, or text can be stored for computer processing with an image scanner by passing an

What is a transaction, What is a transaction? A transaction is dialog ...

What is a transaction? A transaction is dialog program that alter data objects in a consistent way.

Which dependencies of hierarchical tables in the sap system, The structure ...

The structure of Logical Databases reflects which dependencies of hierarchical tables in the SAP system. Foreign Key dependencies

What is clipboard, Clipboard is a temporary storage location in Windows. Th...

Clipboard is a temporary storage location in Windows. The clipart will kept one piece of information at a time when it is manually added to the clipart or is copied there.

Subtraction using 2's complement method of binary number, Subtraction of 00...

Subtraction of 0011.1001 - 0001.1110 using 2's complement method Ans. Firstly 1's complement of 0001.1110 is 1110.0001 and 2's complement is 1110.0010. If a last carry

What are the objectives of uml, What are the Objectives of UML tra...

What are the Objectives of UML trace development of UML; recognize and describe notations for object modelling using UML; describe a variety of structural and be

Real-time systems, This document is intended to help students get started w...

This document is intended to help students get started with the real-time systems (RTS) assignment. We will start on the assignment together in the laboratory. Students will then c

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd