[SOLVED] CS代考 COMP30023: Computer Systems

30 $

File Name: CS代考_COMP30023:_Computer_Systems.zip
File Size: 339.12 KB

SKU: 5854869161 Category: Tags: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,

Or Upload Your Assignment Here:


School of Computing and Information Systems
COMP30023: Computer Systems

Practical Week 4

Copyright By PowCoder代写加微信 assignmentchef

1 Spatial & Temporal Locality
The principle of spatial locality says that if a program accesses one memory address, there is
a good chance that it will also access other nearby addresses. CPU caches take advantage of
this by reading in cache lines from physical memory and reading from the CPU cache is order
of magnitudes faster than actually reading from Physical RAM1.
Write two programs, fast.c and slow.c, which access or modify a two dimensional array in
a way that is fast (exhibits spatial locality) and slow (does not exhibit spatial locality) respec-
Ensure that fast takes at least 0.3 seconds to run.

You may want to use the time command, e.g. $ time ./slow , to measure the time it takes
for a program to finish.

The principle of temporal locality states says that if a program accesses one memory address,
there is a good chance it will access the same memory address again.
Write another pair of programs, fast-temp.c and slow-temp.c, which access or modify a one
dimensional array in a way that is fast (exhibits temporal locality) and slow respectively.

Sample solutions will be later released.
1https://gist.github.com/jboner/2841832

程序代写 CS代考加微信: assignmentchef QQ: 1823890830 Email: [email protected]

Reviews

There are no reviews yet.

Only logged in customers who have purchased this product may leave a review.

Shopping Cart
[SOLVED] CS代考 COMP30023: Computer Systems
30 $