Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Electronic Equipment > PC Hardware Chips > compiler and lo...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 2 Topic 2676 of 2798
Post > Topic >>

compiler and locality and cache write through policy

by ThierryBingo@[EMAIL PROTECTED] Dec 8, 2007 at 09:52 AM

hey,

I have two questions regarding the cache and code optimisation and
woul appreciate your help :)

1- Do current compilers interchange nested loops order to minimise
page fault as well as cache fault? for instance if the arrays are
stored in row order, the following code

for (i = 0; i < 100; i++)
   for (j = 0; j < 100; j++)
      x[i][j] = x[i][j]+3;

will perform much better than

for (j = 0; j < 100; j++)
   for (i = 0; i < 100; i++)
         x[i][j] = x[i][j]+3;

do the current widely used compilers (c++, java) perform such
optimisation automatically?



2- Write Through on write HIT
according to Patterson book: with this policy the data is written in
the cache and the lower-level memory.

my first question if we have two levels caching.  will the write be
done in L1, L2 and the physical DRAM  or just L2 while using this
write policy?

my second question is related to the book evaluation to the technique.
he says that the processor will be held up on writes unless they are
buffered. I don't clearly understand what he means. my understanding
is that with this policy the data is sent to the cache AND the lower
memory level AT THE SAME TIME. no? if yes, how will this policy hold
the processor back ?unless he means that while writing the data to the
off chip memory the data bus is used and no data can be read from the
DRAM?



thanks  for your help
 




 2 Posts in Topic:
compiler and locality and cache write through policy
ThierryBingo@[EMAIL PROTE  2007-12-08 09:52:04 
Re: compiler and locality and cache write through policy
Terje Mathisen <terje.  2007-12-08 19:27:49 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sun Nov 23 12:48:04 CST 2008.