06.08.2013 Views

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

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

More Details Next<br />

Implementation on a specific architecture: Power.<br />

Illustrations of what actually is ordered for several situations.<br />

We will beg<strong>in</strong> with <strong>the</strong> Power synchronization <strong>in</strong>structions.<br />

Approximate clock counts below are not fixed but depends on what is<br />

happen<strong>in</strong>g <strong>in</strong> <strong>the</strong> mach<strong>in</strong>e at <strong>the</strong> moment.<br />

Numbers <strong>from</strong> Christoph von Praun: ”Deconstruct<strong>in</strong>g Redundant<br />

Memory Synchronization” (while at IBM Research).<br />

mnemonic name Power4 cycles Power5 cycles<br />

ldarw/stwxc. load and reserve / store conditional 80 75<br />

hwsync or sync heavy weight sync 140 50<br />

lwsync light weight sync 110 25<br />

isync <strong>in</strong>struction sync 30 10<br />

eieio enforce <strong>in</strong>order execution of I/O not measured not measured<br />

We want to use functions which use <strong>the</strong> less costly <strong>in</strong>structions!<br />

Such as <strong>the</strong> consume operation which is only an ord<strong>in</strong>ary load<br />

<strong>in</strong>struction on Power!<br />

Jonas Skeppstedt (js@cs.lth.se) Lecture 6 2013 46 / 70

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!