Quantcast
Channel: How does memory reordering help processors and compilers? - Stack Overflow
Browsing all 5 articles
Browse latest View live

Answer by Peter Cordes for How does memory reordering help processors and...

TL;DR: It gives the compiler and hardware more room to take advantage of the as-if rule by not requiring it to preserve all behaviour of the original source, only the result of the single thread...

View Article



Answer by Stephen C for How does memory reordering help processors and...

On a modern processor chip, the processor can typically perform register to register operations an order of magnitude (or more) faster that fetching from main memory. Operations that hit the L1 or L2...

View Article

Answer by Andy Turner for How does memory reordering help processors and...

Walk into a cafe and ask for a drink and a sandwich. The person behind the counter hands you the sandwich (which is right next to him), then walks to the fridge to get your drink.Do you care that he...

View Article

Answer by Davide Lorenzo MARINO for How does memory reordering help...

Imagine to have the following code:a = 1;b = 1;a = a + 1; // Not present in the registerb = b + 1; // Not present in the registera = a + 1; // Not present in the registerb = b + 1; // Not present in...

View Article

How does memory reordering help processors and compilers?

I studied the Java memory model and saw re-ordering problems. A simple example: boolean first = false;boolean second = false;void setValues() { first = true; second = true;}void checkValues() {...

View Article

Browsing all 5 articles
Browse latest View live




Latest Images