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

What is the disadvantage of strobe method, What is the  disadvantage of st...

What is the  disadvantage of strobe  method. The drawbacks of strobe method are that the source unit that show the transfer has no way of knowing whether the destination unit h

What is serialization, What is serialization, how it works in .NET? Ser...

What is serialization, how it works in .NET? Serialization is when you persist the state of an object to a storage medium so an exact copy can be re-created at a later stage. S

Show the characteristic of cache memory, Q. Show the characteristic of cach...

Q. Show the characteristic of cache memory? The essential characteristic of cache memory is its fast access time. So very little or no time should be wasted when searching for

By which each connected device is assigned a time slot, Using             ...

Using                    each connected device is assigned a time slot whether or not the device has anything to send. (A) WDM                                        (B)  FDM

What is a sap system, What is a SAP system? The union of all s/w compo...

What is a SAP system? The union of all s/w components that are assigned to the similar databases is known as a SAP system.

Determine no.of processes to avoid race condition, To avoid race condition,...

To avoid race condition, the maximum number of processes that may be simultaneously inside the critical section is The maximum number of processes is one to ignore race conditi

Asymptotic notations, Asymptotic Notations These notations are used fo...

Asymptotic Notations These notations are used for evaluating functions. Assume we have two functions f(n) and g(n) defined on real numbers, Theta Notation Big Notation

Functions for various communication modes, Q. Functions for various communi...

Q. Functions for various communication modes? MPI offers both non-blocking and blocking send/transmitting and receive operations for all modes. Functions for various commun

Central processing unit - computer architecture, Central processing unit (C...

Central processing unit (CPU) : The part of the computer which executes program instructions is known as the processor or central processing unit (CPU). CPU is over single ele

Assembly langaauge microprocessor, write alp to perform bcd addition withou...

write alp to perform bcd addition without using procedure

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