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.

Load<br />

Load relaxed ld<br />

Load consume ld<br />

Load acquire ld; cmp; bc; isync<br />

Load seq cst hwsync;ld; cmp; bc; isync<br />

1 Us<strong>in</strong>g sequential consistency on mach<strong>in</strong>es with relaxed memory models<br />

makes it easier to write correct parallel code which will be slow.<br />

2 Even if your code is safety critical (when people can die due to bugs)<br />

and performance is not an issue, you should not use SC, use a s<strong>in</strong>gle<br />

threaded C program <strong>in</strong>stead.<br />

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

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

Saved successfully!

Ooh no, something went wrong!