Implement a memory management system , Computer Engineering

Assignment Help:

There should be 1 server thread and N client threads, where N is supplied by the user as a command line argument. The server opens a file called "all_requests.dat", the file has the following format:



...
...

client id - refers to the id of the client thread which is between 0 and N - 1. Note this is not the thread id that is assigned by the system.

read/write - refers to whether the request is a read or write request.

page id - refers to id of the page being requested.

contents of page - this field only exists if the request is a write request. It contains the contents of a page that is to be written into the server which is a sequence of alphabet characters (a-z, A-Z) with no spaces or anything else in between and has a maximum size of 4096 characters (size of page for most machines).

Here is a sample "all_requests.dat" file. In this example there are 2 clients with ids of 0 and 1 respectively. Note the read requests do not have any associated page contents.

All_requests.dat file:
0 read 20
1 write 20 helloKKAAA
0 read 1
1 read 21
0 read 20
0 write 8 peter

The server thread also reads from the file called "init_buffer_pages.dat" which contains the initial contents of ALL the buffer pages (you can be sure read and write requests are to pages existing in this file). It has the following format:



.....
.....
.....

Here is a sample init_buffer_pages.dat file:

1 abcdefghigkhhLLK
2 ABjjjjjsskskskskksk
20 hellohowareyou
21 HHBGHH
8 JHjhjjsjjkwje

The program should do the following:

1) The server thread starts and reads in the init_buffer_pages.dat file to initialise the memory buffer.

2) Create N client threads, where the number N is taken from the command line.

3) The server thread reads from all_requests.dat file to get the page read or write requests. The server must process these requests in order from the 1st to the last. For example the 2nd request on the list must be processed before the 3rd request.

4) Each client thread should keep a log of the pages that it has read inside a file called "client_log_n" where n is its thread id. The pages read must be written into the log file in the order that they are received from the server. Please note you only need to log read requests. In the case of a write request the server does not need to contact any of the clients. This will let us know if server is processing the requests in the correct order. The beginning of each entry should contain the page id followed by the page contents. Here is the format:



.....
.....
Here is an example (note in the example below the page 20 has changed between the first and last reads):

20 hellohowareyou
1 abcdefghigkhhLLK
20 helloKKAAA

5) Please note that the server must wait for the current client thread to have finished writing its log entry before getting the next thread to log its read request.

6) When all the clients finish their requests the server thread must end and cause the entire process to end.

Please note we will be testing your program based on if client log files contain the correct data.


Related Discussions:- Implement a memory management system

Online Library management system, Please help me to do mini Project about t...

Please help me to do mini Project about this by creating simple front and back end by using html and css and any programming language like python,php to connect those front end and

Discrete mathmetics and structures, how to prove the partial order R is a t...

how to prove the partial order R is a total order in discrete mathmetics and structures by topological sorting method in c programming

Cookies for one page in your site, How do you turn off cookies for single p...

How do you turn off cookies for single page in your site? We can turn off the cookies for one page:- By setting the Cookie. Discard property false.

Explain inheritance, Can you explain what inheritance is and an example of ...

Can you explain what inheritance is and an example of when you might use it? The process of deriving a new class from an existing class is known as Inheritance. The old class i

Design a xnor gate and define its work, N number of XNOR gates is linked in...

N number of XNOR gates is linked in series that is the N inputs (A0, A1, A2......) are specified in the subsequently way: A0 and A1 to first XNOR gate and A2 and O/P of First XNOR

Enumerate the process of dynamic modelling:, Define the Process of dynamic ...

Define the Process of dynamic modelling: Analyse applicability of actions Recognize object states Create dynamic model diagram Express every state in terms o

Explain public switched telephone network, Explain Public Switched Telephon...

Explain Public Switched Telephone Network. PSTN (Public Switched Telephone Network): This is Public Switched Telephone Network (PSTN), which accommodates two types of subscri

Which device converts BCD to seven segment, A device which converts BCD to ...

A device which converts BCD to Seven Segment is called ? Ans. DECODER is a device that converts BCD to Seven Segment. This coverts binary words in alphanumeric characters.

Why data bus is bidirectional, Why data bus is bidirectional and address bu...

Why data bus is bidirectional and address bus is unidirectional in most microprocessors? The data bus is bidirectional because the data bus has to transfer data among the CPU a

Definition of a micro controllers, Before we take a detailed look about the...

Before we take a detailed look about the Motorola 68HC11 series of micro controllers it is useful to define what is meant by a micro controller. As the name suggests a micro contro

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