首页
网站开发
桌面应用
管理软件
微信开发
App开发
嵌入式软件
工具软件
数据采集与分析
其他
首页
>
> 详细
代写program、代做Python/Java设计程序
项目预算:
开发周期:
发布时间:
要求地区:
Motivation
Virtual memory provides memory for processes above the limit of physical
memory in a computer by swapping unused pages to a secondary storage
device, such as a disk (mechanical or solid-state). This type of hierarchical
memory is also used for CPU instruction caching and in database systems. In
this assignment, you will explore some aspects of constructing hierarchical
memory structures by building a simulation, and then further explore page
replacement algorithms.
Background: Hierarchical Memory
In the context of computer systems, the term "memory hierarchy" refers to the
organization and structure of various types of memory storage devices within
a computer, arranged in a hierarchy based on their proximity to the CPU
(Central Processing Unit) and their speed, capacity, and cost characteristics.
Memory hierarchy is a crucial concept in computer architecture and plays a
vital role in determining the overall performance of a computer system.
The memory hierarchy typically consists of several levels, each with different
properties:
1. Registers: These are the fastest and smallest storage units directly
accessible by the CPU. Registers store data that the CPU is currently working
on. Data can be read from or written to registers in a single clock cycle.
Registers provide the highest performance but have the smallest capacity.
2. Cache Memory: Cache memory is a small-sized, high-speed memory that
sits between the CPU and main memory (RAM). It stores frequently used data
and instructions to reduce the time it takes to access them. Cache memory is
divided into multiple levels (L1, L2, L3), with L1 being the smallest and fastest,
and L3 being larger but slightly slower. Caches use a mechanism called caching
to manage data movement between levels.
3. Main Memory (RAM): Main memory is the primary storage used to store
data and programs that the CPU is actively using. While it is larger in capacity
compared to cache memory, it is slower in terms of access times. Data must be
moved between main memory and cache when needed. The CPUs memory
management unit (MMU) does this automatically.
4. Secondary Storage: This includes non-volatile storage devices like hard disk
drives (HDDs), solid-state drives (SSDs), and optical drives. Secondary storage
provides much larger storage capacity but is significantly slower in terms of
access times compared to main memory. Data from secondary storage must be
loaded into main memory before the CPU can work on it. The virtual memory
subsystem manages the movement of pages from secondary storage to main
memory.
5. Tertiary Storage: This level includes slower and high-capacity storage
solutions, often used for long-term archival and backup purposes. Examples
include magnetic tapes and cloud storage.
The memory hierarchy is designed to optimize the trade-off between speed
and capacity. Data that is frequently accessed is kept closer to the CPU in
faster memory levels (e.g., registers and cache), while less frequently used data
is stored in slower, higher-capacity memory levels (e.g., main memory and
secondary storage). This organization aims to minimize data access times and
maximize overall system performance while balancing cost.
Efficient management of the memory hierarchy is a critical aspect of computer
architecture, and memory hierarchies are designed to ensure that the CPU can
access data and instructions for processing as quickly as possible while
maintaining a balance between cost and performance.
Tasks
Part 1 (30 Points) / Memory Hierarchy Simulation
The tasks below are a simulation and explore hierarchical memory, page faults,
page swapping, and page replacement algorithms. The tasks below explore
only some aspects of the simulation. Subsequent assignments explore
additional details. The assignments are intentionally decomposed to allow for
flexibility and level the effort across all assignments in this course.
You will implement a cache mechanism for a message-oriented data store.
Messages need to be retrieved rapidly but due to the volume of messages not
all of them will fit into main memory and need to be stored in secondary
memory (on disk through the file system).
You may set up the source code in any way you deem reasonable, although we
do expect that you use reasonable software engineering practices, follow
naming conventions, appropriately split code into source files and use header
files as necessary. All code must be written in C.
1. (15 min / 5 pts) Set up a data structure for a "message". The
message must minimally contain a unique identifier, time sent, the
sender (right now that is just some text), a receiver (again, for now,
just some text), content (text), and a flag indicating whether the
message was delivered.
2. (20 min / 10 pts) Write a function create_msg() that creates a new
message with the fields appropriately set and returns a dynamically
allocated message "object". Define arguments and return types as
necessary. You may discuss the design of the function signature and
behavior (but not the implementation) with your peers.
3. (90 min / 35 pts) Write a function store_msg() that stores the
message in a message store on disk. The design of the message
store is up to you, but you should consider how you can quickly
retrieve messages from disk when needed. Define arguments and
return types as necessary and appropriate. You may discuss the
design of the function signature and behavior (but not the
implementation) with your peers.
4. (90 min) / 30 pts) Write a function retrieve_msg() that finds and
returns a message identified by its identifier. You may discuss the
design of the function signature and behavior (but not the
implementation) with your peers.
Part 2 (30 Points) / Caching
Currently, messages are stored on disk (in either a file per message stored in a
folder, or a block per message in a single file). Finding a message therefore
requires access to disk. In this part, you will add a "cache" so that some
number of messages are stored in a paged structure in memory. Your
messages must be a fixed size; the choice of size is yours (but should be a
power of 2, e.g., 256, 512, or 1024 bytes). Of course, part of the message's
bytes are used for "house keeping" such as identification of the sender and the
receiver, time sent, and perhaps priority, whether it is encrypted, etc. Modify
your code from Part 1 as needed.
For testing purposes, a smaller cache and message size is recommended, e.g.,
1024 bytes per message and 16 message cache. Of course, you should adjust
these limits and sizes as you see fit for development and testing.
Having a cache means that every messages that is stored ("sent") is stored in
the cache and also written to disk. When a message is read (found), it should
first be looked for in cache. If the message cannot be found in the cache, the
message needs to be loaded from disk and place in the cache.
Create appropriate lookup data structures to facilitate finding messages in the
cache. In your code, thoroughly describe your strategy and design and why
you chose it. Mention alternative designs and why you did not consider them.
You may discuss your caching strategy and implementation approach with
your colleagues on Piazza, but you may not share code.
Part 3 (20 Points) / Page Replacement
If a message is placed into the cache but no "slot" for a message is open in the
cache, then an existing message in the cache must be replaced. Devise and
then implement two page (a message in our case) replacement algorithms:
1. Random Replacement: a replacement page is chosen at random
2. LRU: the least recently used page is replaced
Part 4 (10 Points) / Evaluation
Design and implement code that will test that the cache mechanism and
calculate the following cache metrics for each page replacement algorithm:
1. number of cache hits per 1000 random message accesses
2. number of cache misses per 1000 random message accesses
3. cache hit ratio per 1000 random message accesses
You need to create a representative message set for testing. You may share
your testing approach, test message mix, and metrics with your colleagues on
Piazza and discuss. You may discuss the calculation algorithms and formulas
and share test messages but not code.
Quality (10 Points)
The remaining points are awarded based on the quality, documentation,
thoroughness, and professionalism of your code.
Simplifying Assumptions, Hints, and Tips
1. You do not need to be concerned about internal fragmentation
within messages.
2. Additional hints and clarifications will be posted on Piazza, so keep
checking Piazza regularly, discuss and participate until the due date.
Submission and next steps
In addition to submitting your code, there are two next steps involved with
grading your practicum: First, we want you to review your own work perform
a self evaluation of you or your team's work. Next, you will have an
opportunity to present your work to us in a review session, where we will take
into account your work, your explanation of design choices and walkthroughs,
and how your self-evaluation lines up with your work.
Here are the next steps:
• Submit a .tar file containing all of your code, notes, explanations,
metrics, and test cases. You may embed everything in your code or
write a separate report. For those working in teams, one
submission per pair is sufficient, but please include a quick note of
the team members in the submission, to help us keep track.
• Schedule time for your review and attend as scheduled
软件开发、广告设计客服
QQ:99515681
邮箱:99515681@qq.com
工作时间:8:00-23:00
微信:codinghelp
热点项目
更多
代做ceng0013 design of a pro...
2024-11-13
代做mech4880 refrigeration a...
2024-11-13
代做mcd1350: media studies a...
2024-11-13
代写fint b338f (autumn 2024)...
2024-11-13
代做engd3000 design of tunab...
2024-11-13
代做n1611 financial economet...
2024-11-13
代做econ 2331: economic and ...
2024-11-13
代做cs770/870 assignment 8代...
2024-11-13
代写amath 481/581 autumn qua...
2024-11-13
代做ccc8013 the process of s...
2024-11-13
代写csit040 – modern comput...
2024-11-13
代写econ 2070: introduc2on t...
2024-11-13
代写cct260, project 2 person...
2024-11-13
热点标签
mktg2509
csci 2600
38170
lng302
csse3010
phas3226
77938
arch1162
engn4536/engn6536
acx5903
comp151101
phl245
cse12
comp9312
stat3016/6016
phas0038
comp2140
6qqmb312
xjco3011
rest0005
ematm0051
5qqmn219
lubs5062m
eee8155
cege0100
eap033
artd1109
mat246
etc3430
ecmm462
mis102
inft6800
ddes9903
comp6521
comp9517
comp3331/9331
comp4337
comp6008
comp9414
bu.231.790.81
man00150m
csb352h
math1041
eengm4100
isys1002
08
6057cem
mktg3504
mthm036
mtrx1701
mth3241
eeee3086
cmp-7038b
cmp-7000a
ints4010
econ2151
infs5710
fins5516
fin3309
fins5510
gsoe9340
math2007
math2036
soee5010
mark3088
infs3605
elec9714
comp2271
ma214
comp2211
infs3604
600426
sit254
acct3091
bbt405
msin0116
com107/com113
mark5826
sit120
comp9021
eco2101
eeen40700
cs253
ece3114
ecmm447
chns3000
math377
itd102
comp9444
comp(2041|9044)
econ0060
econ7230
mgt001371
ecs-323
cs6250
mgdi60012
mdia2012
comm221001
comm5000
ma1008
engl642
econ241
com333
math367
mis201
nbs-7041x
meek16104
econ2003
comm1190
mbas902
comp-1027
dpst1091
comp7315
eppd1033
m06
ee3025
msci231
bb113/bbs1063
fc709
comp3425
comp9417
econ42915
cb9101
math1102e
chme0017
fc307
mkt60104
5522usst
litr1-uc6201.200
ee1102
cosc2803
math39512
omp9727
int2067/int5051
bsb151
mgt253
fc021
babs2202
mis2002s
phya21
18-213
cege0012
mdia1002
math38032
mech5125
07
cisc102
mgx3110
cs240
11175
fin3020s
eco3420
ictten622
comp9727
cpt111
de114102d
mgm320h5s
bafi1019
math21112
efim20036
mn-3503
fins5568
110.807
bcpm000028
info6030
bma0092
bcpm0054
math20212
ce335
cs365
cenv6141
ftec5580
math2010
ec3450
comm1170
ecmt1010
csci-ua.0480-003
econ12-200
ib3960
ectb60h3f
cs247—assignment
tk3163
ics3u
ib3j80
comp20008
comp9334
eppd1063
acct2343
cct109
isys1055/3412
math350-real
math2014
eec180
stat141b
econ2101
msinm014/msing014/msing014b
fit2004
comp643
bu1002
cm2030
联系我们
- QQ: 9951568
© 2021
www.rj363.com
软件定制开发网!