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

Show the classification of networks, There are various approaches to the cl...

There are various approaches to the classification of Computer Networks. One such classification is based on distance approach. Networks can be classified into LAN, WAN and MAN net

How many and gates are required to realize Y = CD+EF+G, How many AND gates ...

How many AND gates are required to realize Y = CD+EF+G ? Ans. Y = CD + EF + G for realize this two AND gates are needed (for CD and EF).

How to manage the web based projects, How to manage the web based projects?...

How to manage the web based projects? Many project management applications contain additional functions useful in the management of group projects. These features may contain g

What is a development class, What is a Development class? Related obje...

What is a Development class? Related objects from the ABAP/4 repository are assigned to the similar development class.  This enables you to right and transport related objects

Explain COMS inverter, Explain CMOS Inverter with the help of a neat circui...

Explain CMOS Inverter with the help of a neat circuit diagram. Ans: CMOS Inverter: The fundamental CMOS logic circuit is an inverter demonstrated in Fig.(a). For above

Illustrate lcd technology, Q. Illustrate LCD Technology? The technology...

Q. Illustrate LCD Technology? The technology behind LCD is known as Nematic Technology since the molecules of liquid crystals used are nematic which implies that rod-shaped. Th

Explain the test instruction, Explain the TEST instruction TEST instru...

Explain the TEST instruction TEST instruction performs the AND operation. The difference is that AND instruction changes the destination operand whereas TEST instruction doesn

How to export a dreamweaver document as xml file, Q. How to export a dreamw...

Q. How to export a dreamweaver document as xml file? Step 1: Choose File -> Open, Step 2: Select document which uses a template (and has editable regions) Step 3: Click O

Explain the process of skolemization., Problem 1. Explain briefly the p...

Problem 1. Explain briefly the process of matching production rules against working memory 2. What are the different kinds of knowledge that need to be represented in AI? Ex

How is transaction processing system affected, How is Transaction Processin...

How is Transaction Processing System affect performance of e-commerce sites? Transaction Processing System influences performance of e-commerce sites: Transaction-Processing

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