Answered step by step
Verified Expert Solution
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 FirstIn FirstOut
L Least Recently Used or C Clock Your cacher should use FirstIn FirstOut 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.
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
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started