Threads in the new ISO C Standard from 2011
Threads in the new ISO C Standard from 2011
Threads in the new ISO C Standard from 2011
You also want an ePaper? Increase the reach of your titles
YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.
Constant Propagation Example 1(3)<br />
Consider <strong>the</strong> follow<strong>in</strong>g code and assume <strong>the</strong> compiler has deduced<br />
size is one:<br />
i = atomic_load(q, memory_order_consume);<br />
a = b[i % size];<br />
What happens if <strong>the</strong> compiler transforms <strong>the</strong> code to <strong>the</strong> follow<strong>in</strong>g?<br />
i = atomic_load(q, memory_order_consume);<br />
a = *b;<br />
Jonas Skeppstedt (js@cs.lth.se) Lecture 6 2013 42 / 70