Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

write makefile and the code in c Assignment Details Your server must implement the functionality explained below subject to the limitations below. Functionality Your new

write makefile and the code in c
Assignment Details
Your server must implement the functionality explained below subject to the limitations below.
Functionality
Your new cacher should take two command line arguments, sizethe size of your cachepolicythe
policy your cache will follow. The policy flag will be present and will be exactly -F (First-In First-Out),
-L (Least Recently Used), or -C (Clock). Your cacher should use First-In First-Out if no policy is given.
./cacher [-N size]
Once initialized, cacher must continuously take newline separated items from stdin until stdin is closed.
For each item received, cacher should access the cache to determine if the item exists. Depending on if the
access resulted in a HIT or MISS , cacher should update the cache accordingly. Namely, on a MISS , the cache
should print out HIT
. On a MISS , the cache should print out MISS
, add the item to the cache,
and, if the cache is full, evict an item from the cache following the caching policy. When stdin is closed, a
summary line should be printed which specifies the number of misses that were compulsory misses and the
number that were capacity misses. Note there are no conflict misses since we have a fully associative cache.
The following is a table for formatting the required outputs.
1
stdout
Cache Hit HIT
Cache Miss MISS
Summary Line
Additional Functionality
In addition to supporting the methods listed above, cacher should not have any memory leaks.
Limitations
You must write cacher using the C programming language. It program cannot use functions, like system
or execve, that allow you to execute external programs. If your submission does not meet these
minimum requirements, then the maximum score that you can get is 5%.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Modern Database Management

Authors: Fred R. McFadden, Jeffrey Slater, Mary B. Prescott

5th Edition

0805360549, 978-0805360547

More Books

Students also viewed these Databases questions

Question

What aspects would it be impossible to capture?

Answered: 1 week ago

Question

Enhance your words with effective presentation aids

Answered: 1 week ago